-
Notifications
You must be signed in to change notification settings - Fork 139
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
Slug field also needs translation. #12
Comments
Hello, About the display option, it works for me, you can maybe copy/paste your code here. About the slug, it's true that currently, it doesn't work for all locales. Normally, it work only for the default_locale (normally force in your edit method as https://github.com/a2lix/DemoTranslationBundle/blob/master/src/A2lix/DemoTranslationBundle/Controller/Backend/ProductController.php#L57). I've got already some pending commits and start to think about a way for resolve this ticket. Regards |
In my case slug for default locale is generated. It is not generated only for translations when annotated with gedmo like that.
As your working on this feature, for now on I disabled slug translations. But it would be great to have translated slug in urls for different locales. Thanks! |
Yes we are agree :) |
First of all thanks for this bundle. It's a timesaver. I'm using an internationalized slug internally generated by the Gedmo\Sluggable\Sluggable, so I don't want it to be in the edit form. If I set 'display' => false, an exception raises so my only workaround now is to make it visible but readonly. I think it's not a good solution so please, fix this issue if you can. Thanks in advance. |
You're welcome. I plan to write some tests before resolve your problem and probably do some refactoring. You can copy/paste your exception |
The exception raised is the usual "duplicated key" (but was an update, not an insert). [2/2] DBALException: An exception occurred while executing 'INSERT INTO page_translations (locale, field, content, object_id) VALUES (?, ?, ?, ?)' with params {"1":"es","2":"slug","3":"titulo-de-la-pagina","4":1}: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'es-1-slug' for key 'lookup_unique_idx' |
any news? |
I still use my original language for slug when the user is in other language. It would be great if this bundle would slugify some field in other language. Still waiting for this issue. @webda2l Do you plan to have a look at this issue? Thanks for this great bundle, anyway! |
This must be resolve in DoctrineExtensionBundle for be clean. |
Great bundle - saved me a lof of time.
Anyway, I was wondering if there's any way to slugify the translation (one of the fields).
First problem is that slug field is always visible. Tried using
display
option but with no results. I accomplished that using'type' => 'hidden'
option.But still, my slug is not generated. When persisting translation entities as it is in gedmo's tutorials, the english translation slug field is generated from english translation name field.
But when using this bundle the slug field is not even in database.
Do you have solution to this problem, or it is a common restriction.
Thanks!
The text was updated successfully, but these errors were encountered: