Closed (outdated)
Project:
Colossal Menu
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Apr 2017 at 22:42 UTC
Updated:
24 Sep 2022 at 02:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mvantuch commentedComment #3
mvantuch commentedFirst patch attached, further work will follow. I had to restructure the menu to remove the {colossal_manu} parameter from edit pages to allow the translations.
Comment #4
mvantuch commentedComment #5
mvantuch commentedSeems like it's working now. Update went through fine and expected fields and properties can be translated as expected. UI could use a bit more polishing though, especially the breadcrumb.
Comment #6
grimreaperHello,
Thanks for the patch but the update fails. I will provide a new patch.
Comment #7
grimreaperHere is an updated patch. Thanks for the review.
Comment #8
grimreaperAfter the update when I switch the language I obtain a fatal error:
InvalidArgumentException: Invalid translation language (fr) specified. in Drupal\Core\Entity\ContentEntityBase->getTranslation() (line 783 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
And the field values (entity reference, long text, etc.) of some link types are lost.
Comment #9
mvantuch commentedYep, sorry about that, should have written a warning about that. There's some weird issues with the data migration when it works fine on a clean installation but fails on an existing site. There will need to be more work and checking of why that happens.
Comment #10
apupiales commentedHello.
I think there is not a clean way to update older colossal menu links without and independent migration process (using migrate or default content), it because this entity is fieldable and do it using direct queries to database could not be a generic solution for different implementations. Also it is not possible to get older field definitions once the entity is updated.
In the other hand, the error mentioned in #8 "InvalidArgumentException: Invalid translation language (fr) specified. in Drupal\Core\Entity\ContentEntityBase->getTranslation() (line 783 of core/lib/Drupal/Core/Entity/ContentEntityBase.php)." is generated in src/Menu/MenuLinkTree.php method createInstances because it assumes we allays have a translation but it is not necessary true, for this y add an additional validation in the attached patch
Thanks guys.
Comment #11
wellsI'm going to close this as outdated. If someone wants to take this up again with a new patch plus target the 3.0.x branch. Thanks!