Hi, I am experiencing problem when using user_id token for the menu path, while using fixed title. The result of the issue is that the menu link appear at the end with the menu router title as its title, when link title (entered from the ui) is expected to be the case.
This happens because on editing of the menu link item the default value of the link is expected to be the one, saved in the {menu_link} table, but the loader function is translating it, which leads to its path actually be replaced by the menu_token module itself. In this way the default value is the replaced path, which in my case includes the administrator's user ID. Then this path is saved to the {menu_links}. This leads to an issue when the link is initiating because it has no access by default in _menu_link_translate() and its title is not updated properly.
In this way the result for me is:
1) The link is using its router title, instead of the one that is set through the menu link UI
2) The link is not using title callback if set for the menu_router
More problems can be related, some of them might be reported but will be hard for me to check them all.
I can fix this by letting the module set a new menu_token_uuid (dummy path) on each update of the link, but I can see a comment in the code that there is a check for reusing the old path? My question is, is it necessary to have the same dummy path ? And why there is a need for "unique" dummy path, why just don't use "front" as such?
Comment | File | Size | Author |
---|---|---|---|
#8 | menu_token-current_user-2369713-8-D7.patch | 1015 bytes | abacaba |
#8 | menu_token-current_user-2369713-7-D7.patch | 1.14 KB | abacaba |
Comments
Comment #1
SimeonKesmev CreditAttribution: SimeonKesmev commentedComment #2
SimeonKesmev CreditAttribution: SimeonKesmev commentedComment #3
SimeonKesmev CreditAttribution: SimeonKesmev commentedThis patch works for me, but has to be reviewed as I am not familiar with the purpose of uuid dummy paths for the links.
Comment #4
m.lebedev CreditAttribution: m.lebedev commentedThanks. It's work.
Comment #5
RaulMuroc CreditAttribution: RaulMuroc commented+1
Comment #6
DevElCuy CreditAttribution: DevElCuy commentedThanks for the patch @SimeonKesmev, btw UUID is required for compatibility with Features. We need to figure out how to fix this issue without breaking compatibility with Features.
Comment #7
abacaba CreditAttribution: abacaba commentedHi guys. This error is caused due to the fact that when the first administrator for the first time creates a link in the database is written in a fake URL, and when he did something re-edit title.. the path to the database be updated upon .. so for example user/[current-user:uid]/edit writes to the database user/admin:uid/edit. If I look this way as admin all right, but an anonymous user does not have permission to view this route. I made a patch please see his work and he fixes this without affecting the basic logic.
Comment #8
abacaba CreditAttribution: abacaba commentedThis correct patch.
Comment #9
abacaba CreditAttribution: abacaba commentedComment #10
DevElCuy CreditAttribution: DevElCuy commentedI'm worried about this, since a new UUID is being created, is there anyway to pull the original? otherwise it will not be friendly with features.
Comment #11
DevElCuy CreditAttribution: DevElCuy commentedComment #12
abacaba CreditAttribution: abacaba commentedThis patch is compatible with the features, I have created a test link moved it and it came with no problems and is edited by the administrator or authorized user can be seen in the future. For the test we must not forget to apply a patch to the donor site.
Comment #14
DevElCuy CreditAttribution: DevElCuy commentedNobody tested the patch but I want to give it a try. Yet, if somebody complains I'll revert it.
Comment #15
DevElCuy CreditAttribution: DevElCuy commentedJust for the record: #2630832: UUID module dependency, UUID module is not a requirement anymore.
Comment #16
abacaba CreditAttribution: abacaba commented_
Comment #17
abacaba CreditAttribution: abacaba commented_
Comment #18
abacaba CreditAttribution: abacaba commented_
Comment #19
abacaba CreditAttribution: abacaba commented_
Comment #21
DevElCuy CreditAttribution: DevElCuy at Dilygent commented@artmix, my apologize for the mistake! I reverted the commit and committed your patch again, this time with you as author. Thanks for your contribution!
Comment #22
abacaba CreditAttribution: abacaba commented@develCuy, Thanks.
Comment #23
DevElCuy CreditAttribution: DevElCuy at Dilygent commented2 weeks no complains.
Thanks everyone for contributing!