Had a search around the issue queue, could not find anything so I thought I would post this.

I get a permission denied 403 page when logged in as user #1 when trying to visit /admin/structure/menu/item/855/edit (where 855 is a MLID for a menu item). When I disable the i18n_menu, then the edit links work as expected, so I know this must be an issue with this module.

Strangely enough, I can delete and add new ones, just never edit.

Anyone have any thoughts?

Comments

wiifm’s picture

Status: Active » Needs review
StatusFileSize
new632 bytes

Attached is a simple patch that resolves the issue for me.

Status: Needs review » Needs work

The last submitted patch, 1800450-i18n_menu-access-denied.patch, failed testing.

pancho’s picture

Version: 7.x-1.7 » 7.x-1.x-dev

Switch to dev, doing the testbot a favor.

pancho’s picture

Status: Needs work » Needs review
jose reyero’s picture

Status: Needs review » Needs work

Better 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']

jose reyero’s picture

Status: Needs work » Postponed (maintainer needs more info)

And btw, I cannot reproduce this with latest dev (well, I never could).

tmorgan’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new11.97 KB
new29.89 KB

Have 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.

jose reyero’s picture

Status: Needs review » Postponed (maintainer needs more info)

Looks 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)

jose reyero’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No follow up, closing.

tmorgan’s picture

Status: Closed (cannot reproduce) » Needs review
StatusFileSize
new15.22 KB
new44.17 KB
new37.79 KB
new39.44 KB
new23.6 KB
new37.94 KB

Sorry 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)

jose reyero’s picture

Title: Cannot edit menu items with i18n_menu module active » Cannot edit menu items with i18n_menu module active (403 page)
Status: Needs review » Closed (cannot reproduce)

@tmorgan,

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."

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)

Sylvain Lecoy’s picture

Status: Closed (cannot reproduce) » Needs work

Here are the steps:

  1. Install Drupal with minimal profile.
  2. Download and install i18n_menu and dependencies.
  3. Navigate to: admin/structure/menu/item/1/translate. One other way to get this is to go to admin/structure/menu/manage/management and try to translate any links.

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:

  1. Either we remove the 'translate' link which leads anyway to an Access Denied page for system (hook_menu) provided items.
  2. Either we find a way to translate the interface string directly from this link, for system menus items.
postrational’s picture

I 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?

postrational’s picture

Ok, 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.

jose reyero’s picture

Priority: Major » Minor
Issue summary: View changes

He :-)

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...

guillaumeduveau’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Jose 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.

Wtower’s picture

Concerning 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

pinoniq’s picture

I 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.

coozila’s picture

Last patch works perfectly, #16 tanks guix

sebastien m.’s picture

Patch #16 works perfectly for me.
Thanks

joseph.olstad’s picture

joseph.olstad’s picture

Status: Needs review » Needs work

Try to trigger testbot

joseph.olstad’s picture

Status: Needs work » Needs review
joseph.olstad’s picture

StatusFileSize
new1.51 KB

Status: Needs review » Needs work

The last submitted patch, 24: 1800450-translate_items_links-16.patch, failed testing.

joseph.olstad’s picture

Title: Cannot edit menu items with i18n_menu module active (403 page) » access deny on admin/structure/menu/item/*/translate with i18n_menu enabled (403 page)
joseph.olstad’s picture

Status: Needs work » Needs review
StatusFileSize
new1.67 KB

Ok, 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

  • joseph.olstad committed 63cc91f on 7.x-1.x authored by wiifm
    Issue #1800450 by joseph.olstad, wiifm, guix, tmorgan: access deny on...
joseph.olstad’s picture

Status: Needs review » Fixed

Thanks @wiifm and @guix and @tmorgan

committed to 7.x-1.x dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

miksha’s picture

I 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?

joseph.olstad’s picture

alen simonyan’s picture

go here

/admin/config/regional/translate/i18n_string

and check menu or other entity to be translated

this will solve problem