Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When content is only published in one language it wont display correctly #169

Open
ndavina opened this issue Apr 12, 2018 · 0 comments

Comments

@ndavina
Copy link

ndavina commented Apr 12, 2018

Our website has 2 languages (English and Dutch).

Problem:

  • I create a blog item just for 1 language (Dutch in this case - no translation in English)
  • I create a another blog item just for 1 language (Dutch in this case - no translation in English)
  • these blog items are visible in the Dutch blog list (this is good)
  • these are not visible in the English blog list (this is good)
  • when I click on the first dutch blog link, it will show the second blog item

Reason:

  • the slug field is empty

schermafbeelding 2018-04-12 om 11 19 36

Solution:

  • get id & slug in function records (LocalizedFrontend.php)
    $qb->select('id,slug') ->where($localeSlug . 'slug = ?') ->setParameter(0, $slug) ->setMaxResults(1);
  • duplicate request object with id of record, just before calling parent::record
    $request = $request->duplicate(null,null,array('id'=>$result['id']));

Details

  • Translate Version: [ 4.11 ]
  • Bolt Version: [ 3.4.10 ]
  • PHP version: [ 7.0 ]
  • Used webserver: [ Apache ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant