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.
Drupal 7.33 added a "preferred_menu_links" tag to the database query that is used by menu_link_get_preferred() to find the preferred menu link for a given path, to make it easier to alter. See for more #1854134: Add a query tag to the query in menu_link_get_preferred() to allow modules to alter the query.
As i18n_menu overrides this function in the hook_init(), it would be nice to keep the function identical and to have the same tag.
Comment | File | Size | Author |
---|---|---|---|
#1 | add_the-2447261-1.patch | 941 bytes | StephaneQ |
Comments
Comment #1
StephaneQAnd here is the patch. I also removed the TODO comment.
Comment #2
rikvd CreditAttribution: rikvd at Clockwork commentedfor a half year in production now, to change the sorting behavior. works like a charm
the i18n_menu module turns the sorting arround, the other way that core does, here the code snippet we use to make the highest menu item, the preferred link
Comment #3
joseph.olstadi18n_menu_init was removed today (in the dev branch 7.x-1.x)
it was replaced with:
i18n_menu_query_preferred_menu_links_alter
Please review , see if you still need a patch for this issue now that i18n_menu_init was removed.
For details about the removal, see:
#881322: Multilevel menu fails to create active menu trail with same link_path in different languages
Thanks
Comment #4
StephaneQI think we can close this issue :)
Comment #5
drupalfan2 CreditAttribution: drupalfan2 as a volunteer commentedIs this patch still necessary for latest Drupal 7 version?
Comment #6
ciss CreditAttribution: ciss at yousign GmbH commented@drupalfan2 Please stop spamming issues with this question. Instead take the time to read the individual issue comments and check wether a patch has been committed. Others will have to do the same in order to answer your question.
If you still can't figure out wether a patch is required, try to apply it or at least post your own conclusion and ask for someone to verify it. Thanks!
Comment #7
drupalfan2 CreditAttribution: drupalfan2 as a volunteer commentedThank you for your answer and sorry for the question.
>>If you still can't figure out wether a patch is required, try to apply it ...
The patch is still appliable. Does this mean that it is still needed? Is there any case where a patch is still appliable but not needed anymore?
Comment #8
ciss CreditAttribution: ciss as a volunteer commentedIf an issue version is "*-dev" then the patch needs to be applied to the git branch, not a release version. The patch does not apply to the branch because the patch context (the surrounding lines that tell git / patch where to insert or change the lines) is no longer present (take a look at the file in question). See the "Version control" link on the project page for instructions on how to get the most recent development version via git.
In comment #3 @joseph.olstad describes the API change that makes this patch obsolete.
Comment #9
drupalfan2 CreditAttribution: drupalfan2 as a volunteer commentedThank you. I will not use dev versions or versions from git. I will use only latest stable version.
So this patch is still appliable but 7.x-1.25 does not need the patch anymore?
Comment #10
ciss CreditAttribution: ciss as a volunteer commentedNo, that patch is not applicable, and hasn't been since 7.x-1.15. Since you apparently need the functionality provided by this patch I again encourage you to carefully read the issue comments as well as issue #881322: Multilevel menu fails to create active menu trail with same link_path in different languages that was linked in comment #3 to gain an understanding of the changes that were made. The API change is similar to this patch, but not compatible.
It may feel tedious, but again this is what everybody else would have to do as well to answer your question. I recommend reading issues by starting with the description, then working your way up from the last comment. Pay attention to related issues that might provide more details as well as mentioned/logged commits.
Comment #11
drupalfan2 CreditAttribution: drupalfan2 as a volunteer commentedThe problem seems to be, that 'platform build" (platform.sh) does not output/show any patch error although the patch is not appliable anymore.
platform build output:
Why no error?
But manually patching with "patch -p1 < add_the-2447261-1.patch" failes.
Is platform.sh not able to recognize patch applying errors?