Closed (fixed)
Project:
Internationalization
Version:
7.x-1.x-dev
Component:
Menus
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2012 at 20:57 UTC
Updated:
6 May 2019 at 18:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wiifmAttached is a simple patch that resolves the issue for me.
Comment #3
panchoSwitch to dev, doing the testbot a favor.
Comment #4
pancho#1: 1800450-i18n_menu-access-denied.patch queued for re-testing.
Comment #5
jose reyero commentedBetter than a 'magical fix' we should understand what's going on before, because all the patch is doing is dropping other previous values in $items['admin/structure/menu/item/%menu_link/edit']
Comment #6
jose reyero commentedAnd btw, I cannot reproduce this with latest dev (well, I never could).
Comment #7
tmorgan commentedHave installed 7.x and just now, tonight, the latest dev release for the Internationalization module (i18n-7.x-1.x-dev)
With the Internationalization module installed and the Internationalization (core) item active (Internationalization 7.x-1.7+22-dev)
_all_ menu "edit" selections generate a 500 internal server error "The website encountered an error while retrieving http://mysite.com/admin/structure/menu/manage/main-menu. It may be down for maintenance or configured incorrectly."
With the Internationalization module deactivated, the menu trees load properly and can be edited/arranged as expected.
Working with 2 languages English and Chinese.
Presently, the only way to deal with menu items - order, placement, text changes, is to deactivate all the i18n components so that the Internationalization item can be deactivated.
Then, to deal with the translations and pairings, reactivate everything.
I've got about 300 pages that I need to manage in both languages (~600 total) and the menu / navigation management is essential. I'd really like to have a better solution.
Comment #8
jose reyero commentedLooks related to #1776144: 500 Internal Server Error while Listing Menu links in Admin area ( Works ones I turn off the Internationalization module)
But I still cannot reproduce it with Drupal core + i18n, so wondering:
- Is there other contrib modules you need to reproduce it? (easy, just keep core modules and i18n_* modules enabled)
- Could it be language specific? Issues with Chinese, Arabic maybe? (need information about your default language, menu i18n settings, etc..)
@tmorgan,
Though it may be related, it doesn't look like the same issue as #1776144: 500 Internal Server Error while Listing Menu links in Admin area ( Works ones I turn off the Internationalization module)
Have you tried whether the patch in #1 fixes it?
Reminder: you need to run update.php after updating the module to latest dev.
Maybe related, #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
Comment #9
jose reyero commentedNo follow up, closing.
Comment #10
tmorgan commentedSorry that you are unable to reproduce the problem.
I can reproduce the problem - repeatedly and consistently - edit menu fails (500 server error) with i18n module active; works fine with i18n off. Tried selectively activating modules where possible (no dependencies). The module that seems to be causing the problem is "Internationalization" - when it is inactive, all the menu functions work.
I did follow up with captures and messages. And tried contacting Mr. Reyero directly - no reply. Might want to allow a bit more than one week before closing due to "lack of response."
And yes, I have installed the latest version (Jan 13, 2013) and yes, I ran the update.php script, and yes, it still fails.
Default language : English
1. All i18n modules available active
2. select Structure -> Menus -> Get list of menus
3. select "Edit" for ANY menu on the list (not limited by selected menu - consistent for ALL)
4. get "500 server error"
1. Only "Internationalization" module active
2. select Structure -> Menus -> Get list of menus
3. select "Edit" for ANY menu on the list (not limited by selected menu - consistent for ALL)
4. get "500 server error"
1. "Internationalization" module NOT active
2. select Structure -> Menus -> Get list of menus
3. select "Edit" for any menu on the list (not limited by selected menu - consistent for ALL)
4. get menu structure with all edit features available - in both (I have 2 enabled) languages
As a side note, when editing content, both my source (English) and translated language (Chinese) menus are listed, but the translated language menus show "(disabled)" next to each item -- even though they are enabled and working (tested)
They show as enabled when I can see the menu list (only available with Internationalization disabled)
Comment #11
jose reyero commented@tmorgan,
You always can reopen it...
And no, I'm not replying any module's questions / issues by email or private messages.
About your "server error", this is not what this issue is about (it was "access denied", see the original report), so if you want to get any help, better follow up on the other issue.
This is still "cannot reproduce" until someone can post a step by step to reproduce the original "access denied" error with latest version (other modules, menu settings, permissions, etc)
Related #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
Comment #12
Sylvain Lecoy commentedHere are the steps:
Observe the Access denied.
I don't know how it is possible you can't reproduce this...
Now the reason (and main difference) is that this menu link is from a hook_menu() and provided by the system. This also happen for contrib submitted menus. These menu items are translatable in the config > translate interface screen. So far so good, we have a work-around (not sexy) and two options to fix this:
Comment #13
postrational commentedI can reproduce the bug as Sylvain Lecoy describes it with one extra step - clear all caches.
1. Install Drupal.
2. Install i18n_menu and dependencies.
3. Clear all caches.
4. Navigate to: admin/structure/menu/item/*/translate.
Result: Access denied
Tested with Drupal 7.26
Is there a recommended workaround?
Comment #14
postrational commentedOk, this is not a real bug, the module just redirects to 403 instead of providing a friendly error message.
Workaround (properly configure menu for localization):
1. Edit menu (/admin/structure/menu/manage/main-menu/edit)
2. Select Translate and Localize in Multilingual options.
3. Save.
Translations should start working, 403 Access denied disappear.
I think that the module should provide feedback to the user in this situation instead of simply stating that access is denied.
Comment #15
jose reyero commentedHe :-)
Did anyone notice that while the original report says 'cannot edit menu item', the follow up ones say 'access deny on /menu/item/*/translate' ?
So no, I cannot, and I doubt anyone can reproduce the original report. But yes, I can see the 'access deny' when trying to translate a menu item that is not set to be *translatable*
We all should read more quietly and carefully I guess...
Now I think the bug, that is downgraded to minor because that is what it is, should be fixed by adding a proper access callback to the 'translate' tab, so it doesn't show up for menu items that are not translatable. This I would call a minor usability issue, and agree it lacks proper information besides 'access deny'.
No major bug. Major mess. If anyone has the time to post a patch...
Comment #16
guillaumeduveauJose is right, the initial issue 'cannot edit menu item' can't be reproduced so it should be closed. But since the new issue 'access deny on /menu/item/*/translate' is discussed here, I can't decide whether to close that one and open a new one, or just rename that one.
Concerning the issue 'access deny on /menu/item/*/translate' :
- All good with the 'translate' tab : it's not on the menu item edit page (admin/structure/menu/item/MLID/edit), when the menu is either set to "No multilingual" or "Fixed language".
- The problem is that on the 'List links' tab of the menu (admin/structure/menu/manage/MENU-NAME), translate links are displayed even if the menu is set to "No multilingual" or "Fixed language".
This patch makes those links appear only for menus set to "Translate and localize".
With the patch, there are still some issues with some menu items that were not created manually, like if you generate a menu with Devel, then set it to Translate and localize" : admin/structure/menu/item/*/translate gets you an access denied, unless you edit the menu item and save it first.
Lastly, while I'm at it, and while we are in a multi-issues page (...), I just can't get why on earth on a "No multilingual" menu, we would want to translate the menu name. It does not work for me by the way (I still get the non-translated menu name), but the point is why would we need to translate only the menu name and not its items ? Maybe we should just avoid to offer the 'translate' tab on those "No multilingual" menus. I can have a look at it in another issue if you say so.
Comment #17
Wtower commentedConcerning the 'translate' page permission, I have experienced the same. Here are two links that I found relevant and helped me:
http://drupal.stackexchange.com/questions/85222/access-denied-occurs-after-translate-menu-link
https://www.drupal.org/node/2316659
Comment #18
pinoniq commentedI was about to propose the exact same patch as in #16 . It kind of makes no sense to add a translate link if translation option is set to 'Fixed language'.
Tested and it works.
Comment #19
coozila commentedLast patch works perfectly, #16 tanks guix
Comment #20
sebastien m. commentedPatch #16 works perfectly for me.
Thanks
Comment #21
joseph.olstadComment #22
joseph.olstadTry to trigger testbot
Comment #23
joseph.olstadComment #24
joseph.olstadComment #26
joseph.olstadComment #27
joseph.olstadOk, here's a reroll for the latest dev.
note: I have not yet tested this patch, nor have I tested the above described scenario.
just going to see what testbot simpletest says
Comment #29
joseph.olstadThanks @wiifm and @guix and @tmorgan
committed to 7.x-1.x dev
Comment #31
miksha commentedI installed latest Drupal 7.61 with i18n_menu Version: 7.x-1.26 and after adding language and activating translation on Main Menu I clicked on translate link for "Home" and got "You are not authorized to access this page.". I searched a bit and didn't found a solution on the internet, but then I clicked on edit link for the menu item and saw that item is language neutral. When I set it to English and saved, I was later able to click Translate link without access denied message.
Shuldn't i18n_menu give message that user cannot translate link that is language neutral instead of showing access denied page?
Comment #32
joseph.olstadmiksa, please follow up here: #2841532: translation main menu access denied error
Comment #33
alen simonyan commentedgo here
and check menu or other entity to be translated/admin/config/regional/translate/i18n_stringthis will solve problem