Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Not having it set breaks an optimization in menu_link_save() to avoid updating - this patch saved over 2,000 queries for me during menu_rebuild().
Comment | File | Size | Author |
---|---|---|---|
#16 | i18n-2338735-revert.patch | 414 bytes | Stevel |
Comments
Comment #1
catchAnd the patch.
Comment #2
pbuyle CreditAttribution: pbuyle commentedI investigated a performance issue on a site with 1,257 menu links. Turns out the site does 257 update queries on each cache rebuild.
Tracing the issue revealed that the
array_intersect_key($item, $existing_item) != $existing_item
comparison inmenu_link_save()
always fail because of$item['i18n_tsid']
. Apllying the patch seems to fix the issues.Comment #3
sylus CreditAttribution: sylus commentedWish I knew about this little gem of a patch earlier! Adding a tag so can increase its visibility.
Comment #4
joseph.olstadRTBC+1 , get it in ASAP
Comment #5
joseph.olstadbumping the priority on this up to critical, as this improvement is amazing
menu_rebuild used to take a very long time, now it happens in a flash.
And this speeds up cache clear because menu_rebuild happens on cache clear.
Comment #7
joseph.olstadGreat work @catch, this improvement alone warrants a release.
Comment #8
candelas CreditAttribution: candelas as a volunteer commentedThanks @catch :) My site was going nuts with time-outs because menu rebuilds. After updating i18n now it stopped.
Comment #9
joseph.olstadya @candelas , I agree, it was urgent to get a release with this patch. Good to hear your positive feedback.
Comment #10
candelas CreditAttribution: candelas as a volunteer commentedthanks @joseph. I added a new language and more that we translated, more errors. I am very very happy to find this issue and that you made a new release. So I proposed to add it in Commerce Kickstart distribution.
Comment #12
joseph.olstadWhile I very much like the performance improvement, unfortunately this change caused a regression:
#2848806: Menu translation broken in 1.14/15 when editing 3 or more translations
Short term:
- Looks like we're going to have to revert this change and publish a new release until we can find a solution that avoids regressions?
Long term:
- Any assistance is welcome for finding an optimal solution.
Comment #13
joseph.olstadI've added potentially a second way to move forward.
Option 1.) revert the above commit using the revert patch in
#2848806: Menu translation broken in 1.14/15 when editing 3 or more translations
Option 2.) use patch 18 in
#2848806: Menu translation broken in 1.14/15 when editing 3 or more translations
Comment #14
joseph.olstadComment #15
Stevel CreditAttribution: Stevel commentedIn favour of option 1 for the time being, since this also breaks entity translation. See #2836238: Entity Translation Menu (entity_translation_i18n_menu) compatibility check against the i18n_menu (7.x-1.x-1.14).
Comment #16
Stevel CreditAttribution: Stevel commentedAdding the reverse patch
Comment #17
joseph.olstad@Stevel, there's already an open issue for this, with a patch.
#2848806: Menu translation broken in 1.14/15 when editing 3 or more translations
Comment #18
joseph.olstadI was waiting for some reviews, but no one reviewed it, so the revert patch has been sitting there for a while.
Comment #19
joseph.olstadReverted commit 307b54dcdb from oct22, 2016