Hi.
I have a production site where I'm using the Webform 7.x-4.0-alpha8. Only in the webform pages (all forms) I'm receiving the following messages:
Notice: Undefined offset: 4 in _menu_translate() ( line 777 of /home/mysite/public_html/includes/menu.inc).
Notice: Undefined offset: 4 in _menu_translate() ( line 783 of /home/mysite/public_html/includes/menu.inc).
Notice: Undefined offset: 4 in _menu_translate() ( line 777 of /home/mysite/public_html/includes/menu.inc).
It is important to note that this error only occurs in webform pages, which makes me believe that the problem is with the Webform module.
Any idea?
Tks
| Comment | File | Size | Author |
|---|---|---|---|
| #43 | webform-menu_translate-2038933-42.patch | 933 bytes | danchadwick |
| #24 | webform-email_commands_menu_type-2038933.24.patch | 1.43 KB | danchadwick |
Comments
Comment #1
astutonetThis error persists in the alpha9 dev version. Between lines 767 and 790 of the menu.inc file we have the following code (the lines indicated in the error are commented):
The site with this issue also uses the modules Webform Phone and Phone.
I did some research on issues similar to this and found some cases that can go one way:
#676010: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate() and
#1214076: "Notice: Undefined offset 4 in _menu_translate" because of the way that the fieldmap paths are defined.
Any idea?
Comment #2
astutonetMaybe this is a Core bug:
#676010: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate()
Comment #3
quicksketchI can't reproduce this problem myself. After looking at the other issue, an obvious question is: do you have Diff module installed? Or other modules that display tabs on nodes?
It seems like according to that issue, that using "%" placeholders in hook_menu() triggers this bug. But Webform doesn't use any "%" placeholders to begin with. In comment #73 (#676010-73: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate()) @sun suggested that switching "%" placeholders to named placeholders like "%node" solves the problem. Webform already does this with all its menu entries, so we can't assume the same solution would fix the problem here.
This report is the first time this problem has been reported in the Webform queue. At this point I think it's likely caused by another module. The 4.x version of the module even has the same hook_menu() entries as 3.x, so this seems like it would affect both versions the same.
Comment #4
astutonetHi @quicksketch, tks for repply.
I don't have installed the Diff module or any other module to display tabs on nodes. How we can see in some comments (#1 until #7), was suspected that the question for that issue was related to the core of D7 and the messages of the error are the same.
The site where this issue occurs is in production and we use the following modules with Webform:
- Phone
- Webform Phone and
- Capctha
As you say, we can't assume the same solution to fix the issue, so I'm willing to help solve the issue (a lot of error messages in dblog and displayed messages to the users in webforms contributed to this).
I have a mirror of this site on localhost, and I wonder if there is a way to identify the source of this issue so that I can help solve.
How we can help?
Tks.
Comment #5
astutonetSorry...
Comment #6
quicksketchStart with a fresh installation of Drupal and Webform and see if it has the same problem (it shouldn't), then add the same changes you have on your production site until the problem reoccurs. We can't solve this problem until it's reproducible.
Comment #7
quicksketchBack to postponed until this can be reproduced from a fresh install of Webform.
Comment #8
astutonetHi @quicksketch.
I was trying to reproduce the error in question on a clean site and realized that there was a new update to Webform 7.x-4.x-dev.
I updated to the new version in the site that is experiencing the problem and sent the new files to the server. It was then that I realized that there were reasonable changes in Webform 7.x-4.x.
The main one will cause me big inconveniences and probably I have to revert to version 7.x-3.x, because my host uses PHP 5.2.17 and the new 7.x-4.x-dev requires PHP 5.3.
To help, I have over a hundred webform forms on this site.
Can you help me here or I'll have to open another issue?
Tks
Comment #9
quicksketch@astutonet: Please open a new issue about PHP versions, or post comments to this issue: #2058361: Increase PHP requirement for 7.x-4.x version to PHP 5.3.
Comment #10
astutonetI try to reproduce these errors on a clean installation. Impossible.
I had to put into practice more aggressive action and uninstalled the Webform module. I had to recreate all the forms, but now I have no more errors.
Thanks for the help.
Comment #11
leanderl commentedHello, I experienced this problem too, with 7.x-4.0-beta1 after upgrading from alpha. And think I may have found the solution and what's causing the problem. I'll begin by posting the fix, so you wonät have to read my wordy explanation if you don't want to.
quote from https://drupal.org/comment/4120348#comment-4120348:
----
file: webform.module
function webform_menu()
old code:
new code:
----
/end quote
I spent a few hours reading various threads on drupal.org and then came to the conclusion that the problem does indeed reside in the webform module after reading most posts in this mega long thread: https://drupal.org/node/676010
It's a discussion about a similar problem with the diff module. So I followed the method of doing a "backtrace" from comment #52 in that discussion. And then found that somehow the webform.emails.inc is "sneaking" its way into the menu system where it is not needed and then somehow get's in conflict with menu_translate. Then I started staring blankly at the code for while which didn't help. Then I searched again in the issue queue for webform and to my astonishment this problem seems to have existed before and been fixed. In #19 of this thread https://drupal.org/node/1029498 there's a patch in #22 and the issue is marked as fixed. but somehow the problem has made its way back into the module. I suppose it only occurs under special circumstances for non-english installations otherwise it would have gotten more attention. But the changes in the patch does seem to make a lot of sense and fixed my problem on a "sensitive" production site without having to reinstall or rebuild anything which would have been a great pain since the webform in question has a lot of fields and a lot of conditions.
Thanks for a great module and I hope this fix will make its way into the next beta or rc release.
Comment #12
Roensby commentedSolution in #11 confirmed to fix the issue on Drupal 7.24 with webform 7.x-4.0-beta1.
Comment #13
marty2081 commentedI can also confirm that the solution in #11 fixes the notices with webform 7.x-4.0-beta1. I haven't noticed any side-effects resulting from the change of the type from MENU_LOCAL_TASK to MENU_CALLBACK.
Comment #14
citricguy commentedPost #11 worked here as well. I upgraded from 3.x to 4.x while working through this.
Comment #15
gge commentedPost #11 doesn't seem to work with 7.x-4.0-beta3
Comment #16
strykaizerSame issue here with webform 7.x-3.20 where my CT has multilangual support (using content translation).
#11 fixxed the problem
Comment #17
larry rosenfeld commentedSame issue here (just for Webform pages) with Webform 7.x-3.20. It occurred (on a testbed and then the production site) after I:
#11 patch fixed it for me as well -- thanks leanderl ! If you have follow-up questions, please feel free to contact me at ljr@unc.edu . And, of course, thanks so much for such an excellent module!
Comment #18
nicolas bouteille commented#11 worked for me too on RC3 after clearing caches
there is a new menu entry webform_menu_email/clone though between webform_menu_email and webform_menu_email/delete.
I personally applied the modification (MENU_CALLBACK) to it aswell. No error so far but haven't fully tested.
Comment #19
nicolas bouteille commentedComment #20
JCB commentedI can confirm that #11 worked for me - ONLY after I cleared cache.
Comment #21
kari.kaariainen commentedThis happens also without Webform. Fresh minimal installation of Drupal 7.28 plus OG and some other modules but no Webform.
Comment #22
kvantstudio commented#11 worked for me too, problem exist only on webform pages!!!
Comment #23
danchadwick commented@quicksketch -- Just looking at this, it does seem that Edit, Clone and Delete, which are links generated in the table of e-mail settings, should in fact be MENU_CALLBACKS. These items should not generate any actual menu entries (menu item, tab, or local action). In my experience this is normally harmless, but there must be some situation where the menu module is not expecting to see what is essentially a tab within a tab within a tab.
node/%webform_menu/ -> this is the node
webform/ -> This is the Webform tab
emails/ -> This is the secondary E-mail menu (not shown as a tab in most themes)
%webform_menu_email -> Oh dear, I'm out of stuff to show this menu entry.
When I get a chance, I'll test and commit this change, unless you see a reason to the contrary.
Comment #24
danchadwick commentedAttached patch removes titles (not used) and changes type to MENU_CALLBACK for Edit, Clone, and Delete e-mail settings commands.
Comment #26
danchadwick commentedPushed to 7.x-4.x, 7.x-3.x, and 8.x-4.x. I did not change the 6.x branch because I was not sure anyone had the issue and I think the menus are a bit different in D6. If anyone feels that D6 needs to be changed, please make the changes from the patch, test, and re-open, changing the version to 6.x
Comment #27
danchadwick commented@leanderl - Darn it. Forgot to attribute the solution to you in the commits. My sincere apologies for the oversight.
Comment #29
danchadwick commentedComment #30
cmedina commentedI can also confirm that the solution in #24 fixes the notices with webform 7.x-4.8.
Thanks.
Comment #31
jcuna commentedI too can confirm that this solution works on webform 4.8
Thanks a lot.
Comment #32
danchadwick commentedJust so everyone understands, this patch is in 4.8. If you're using 4.8, you're all set.Comment #33
jcuna commentedHi Dan,
Thanks for all the help and all the fixes you included in the latest release.
I just updated to 4.8 this morning and had to use this patch. Am I missing something?
Comment #34
cmedina commentedDan,
I think you are wrong because I had got release 4.8 and it had not got this patch.
Comment #35
danchadwick commentedAh. I see know. This patch broke the breadcrumbs and node tabs. #2472643: Breadcrumb and node tabs missing from e-mail add, edit, clone, and delete.
So we are back to square one. We need a solution other than the patch, which breaks the breadcrumbs and node tabs.
Comment #36
danchadwick commentedEven though this issue is for the diff_menu module, it started out as a core menu issue:
#676010: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate()
It is not clear to me why in some circumstances _menu_translate is being called for a path with $map having fewer elements that $router_item['number_parts']. It's like its trying to match a router item node/NID/webform/email/EMAIL_ID when the actual math is just node/NID/webform/email.
Let's start by some clear instructions for how to reproduce this. What are the MINIMAL modules needed, and what path to I visit to exhibit the problem.
The patch above is NOT the right fix.
Comment #37
danchadwick commentedAlso #1029498: Undefined offset errors caused by Webform menu entries. The last comment by sun is particularly interesting. Alas, we have already implement menu loader functions (webform_menu_load and webform_menu_email_load in this case), so I don't see how his comment at the end help.
I really need to be able to reproduce this. I suspect some other module is adding menu items that is causing the problem.
Comment #38
danchadwick commentedLet me be more blunt.
If you can reproduce this bug, take the patch back out and make instructions to reproduce it. Otherwise, it will never get fixed and if you keep applying the patch, you will never have correct breadcrumbs and tabs.
I believe it is a conflict with another module.
Comment #39
adminterranova commentedI have an unpatched install of:
Drupal 7.36
Webform 7.x-4.8
Webform Confirm Email 7.x-2.3
Webform Rules 7.x-1.6
IF
i choose "Send all e-mails in the default format" for the following option
(in:: Home » Administration » Configuration » Content authoring » Webform settings)
Format override
( ) Per-webform configuration of e-mail format
(X) Send all e-mails in the default format
Force all webform e-mails to be sent in the default format.
THEN
i get the following bunch of errors on the edit page and on the webform itself (also for anonymous users):
Hope this helps...
Comment #40
danchadwick commented@adminterranova -- can you reproduce this without confirm e-mail? Without Webform rules?
I'm away for a few days, but I'll see if I have internet access and time.
Comment #41
danchadwick commentedReproduced and fixed. Don't need webform_rules or rules. The "format override" is the important key to reproducing the issue.
Will post patch and commit fix within a day or two.
Comment #43
danchadwick commentedCommitted to 7.x-4.x and 8.x
Comment #45
joshuautley commentedI noticed this error after installing the Flag module. I can confirm the patch is already in the Webform module.
Seems like Flag is having a similar issue. I'm adding a link to that thread so there can be some cross assistance.
https://www.drupal.org/node/2464867
Comment #46
wileysegovia commentedSame as comment #21 above, we also do not have WebForm installed, and are getting this error:
[X] Notice: Undefined offset: 4 in _menu_translate() (line 787 of /var/www/html/projectname/includes/menu.inc).
It happens when I click on the Structure link from the /admin/structure/blocks page in the breadcrumbs.
Comment #47
BarisW commentedThanks DanChadwick for the patch. This fixes the notice.
Comment #48
vistree commentedHi, I hoped to find a solution for my problem. After updating webform 7.4.12 to 7.4.14 warning restarted to be displayed. I already tried the current dev + downgrading to 7.4.12 - but in any case I see now the following warnings:
Any help / idea on how to debug this?
#update: I opened a new issue for this: https://www.drupal.org/node/2861076 #