Download & Extend

Undefined offset errors caused by Webform menu entries

Project:Webform
Version:7.x-3.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I get the following error when viewing a webform:

Notice: Undefined offset: 4 in _menu_translate() (line 760 of C:\Users\ari\Desktop\mowes_portable\www\includes\menu.inc).
Notice: Undefined offset: 4 in _menu_translate() (line 766 of C:\Users\ari\Desktop\mowes_portable\www\includes\menu.inc).
Notice: Undefined offset: 4 in _menu_translate() (line 760 of C:\Users\ari\Desktop\mowes_portable\www\includes\menu.inc).

It happens every time the form is viewed.

The webform seems to work normally, however. I can submit information and recall it just fine.

Comments

#1

confirmed. subscribing

#2

Hello,

That helped me to fix the bug: https://bugs.launchpad.net/pressflow/+bug/604401

Stefan

#3

That fix did not work for me it still left me with:

Notice: Undefined offset: 4 in _menu_translate() (line 766 of C:\Users\ari\Desktop\mowes_portable\www\includes\menu.inc).

#4

I'm having this same issue.

* Notice: Undefined offset: 4 in _menu_translate() (line 760 of /home/content/72/7233672/html/includes/menu.inc).
* Notice: Undefined offset: 4 in _menu_translate() (line 766 of /home/content/72/7233672/html/includes/menu.inc).
* Notice: Undefined offset: 4 in _menu_translate() (line 760 of /home/content/72/7233672/html/includes/menu.inc).

Comes up 3 times using the webform plugin on Drupal 7.

Applied the patch as detailed above and still leaves me with one remaining error.

* Notice: Undefined offset: 4 in _menu_translate() (line 766 of /home/content/72/7233672/html/includes/menu.inc).

#5

same here, subscribing

#6

I'm 'really' new to Drupal and the community... what do people mean when they say ... 'subscribing'.

#7

@tremor: On drupal.org you currently have to post a comment to an issue for it to show up in your tracker at user/x/issues, so people post comments to "subscribe". They can also configure their account to receive e-mail updates on issues that hey have participated in. So until we add a "real" subscription mechanism, people just post "subscribe", which is extra annoying for everyone else that has subscribed already, since then they get a bunch of e-mails that just say "Subscribe". :P

In any case it's crudy for the time being.

#8

I can't reproduce this problem on a stock Drupal 7.0 and Webform HEAD installation checked out from CVS. Does this problem still exist when using a CVS checkout or the dev version?

#9

Here is an example http://www.twinlakeshomes.info/content/test of the issue that i'm having. Additionally, it is ignoring my theme and global configuration settings to not display authored by information.

I am using WebForm 7.x-3.6

#10

Subscribing to this.
I am using WebForm 7.x-3.6

BTW I did not have this warning until I added the form to my main menu - after testing that it worked - from the webform interface, but removing it from the main menu didn't make it go away....

#11

Status:active» postponed (maintainer needs more info)

I am using WebForm 7.x-3.6

Please update to the dev version and confirm this problem still exists. As I said I can't confirm this problem on the latest dev version, leading me to believe that the problem has been solved. Unless this is confirmed, I'll close this issue.

The Dev version may be found by clicking "View all Releases" from the project page, eventually getting you to this page where it may be downloaded: http://drupal.org/node/730862.

#12

I upgraded to the dev version, ran the update script, and I still get the same undefined offset errors.

#13

I disabled, uninstalled and removed the /webform files... and then installed from the dev version. I left the fix from the post above intact in my include/menu.inc

The result is a working webform. My only suggestion now is that the author information "Submitted by name on Tue, 02/08/2011 - 09:11" be removable, or follow the settings of the theme when display author information is disabled.

--edit--
I found where to remove the authored by information... once again confirming that if you look hard enough, the feature is usually somewhere in drupal and drupal plugins.

#14

This time I fully uninstalled the module, installed the dev version (not with the patch, unlike post #13) and then rebuilt my form. It worked fine. I then added it to the main menu, and everything worked fine -- no offset errors! hooray!

I did seem to have some issues with formatting of both the email message and the confirmation, will look into the issue list and maybe write again....

#15

Hm, so what we're seeing is that this issue doesn't come up on clean installs but the only current solution may be to reinstall the module. I'd expect that upgrading to the latest dev version and flushing caches (and running update.php) would probably be sufficient also.

#16

This issue still occurs after upgrading to dev, clearing the caches and running update.php.

#17

I have done some debugging and the calls to _menu_translate are as follows:

$router_item["path"] => "node/%/webform/emails/%/delete"
$path_map => {
[0]=> "node"
[1]=> "34"
}

$router_item["path"] => "node/%/webform/emails/%"
$path_map => {
[0]=> "node"
[1]=> "34"
}

I can try to debug further if you need me to.

#18

These errors show when "Format override" is set to "Send all e-mails in the default format"

:)

#19

Status:postponed (maintainer needs more info)» needs review

Making the changes as below, solved the problem for me, ... and I'm still able to add, edit and delete e-mails to a webform.

In short: change type from MENU_LOCAL_TASK to MENU_CALLBACK on said items. The changes look logical to me: edit and delete e-mail are NOT part of any menu, they are listed on the e-mails page, not in the webform tabs.

file: webform.module
function webform_menu()

old code:

  $items['node/%webform_menu/webform/emails/%webform_menu_email'] = array(
    'title' => 'Edit e-mail settings',
    'load arguments' => array(1),
    'page arguments' => array('webform_email_edit_form', 1, 4),
    'access callback' => 'node_access',
    'access arguments' => array('update', 1),
    'file' => 'includes/webform.emails.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%webform_menu/webform/emails/%webform_menu_email/delete'] = array(
    'title' => 'Delete e-mail settings',
    'load arguments' => array(1),
    'page arguments' => array('webform_email_delete_form', 1, 4),
    'access callback' => 'node_access',
    'access arguments' => array('update', 1),
    'type' => MENU_LOCAL_TASK,
  );

new code:

  $items['node/%webform_menu/webform/emails/%webform_menu_email'] = array(
    'title' => 'Edit e-mail settings',
    'load arguments' => array(1),
    'page arguments' => array('webform_email_edit_form', 1, 4),
    'access callback' => 'node_access',
    'access arguments' => array('update', 1),
    'file' => 'includes/webform.emails.inc',
    'type' => MENU_CALLBACK,
  );
  $items['node/%webform_menu/webform/emails/%webform_menu_email/delete'] = array(
    'title' => 'Delete e-mail settings',
    'load arguments' => array(1),
    'page arguments' => array('webform_email_delete_form', 1, 4),
    'access callback' => 'node_access',
    'access arguments' => array('update', 1),
    'type' => MENU_CALLBACK,
  );

#20

Agree with #18 - These errors show when "Format override" is set to "Send all e-mails in the default format" - changed this setting an the errors went away.

#21

Thanks fietserwin, sounds like a logical set of changes. I can't figure out what e-mail format would have anything to do with these errors, sounds like we're likely talking about two separate problems.

#22

Title:Undefined offset errors» Undefined offset errors caused by Webform menu entries
Status:needs review» fixed

I've committed this patch based on fietserwin's suggestions. If you still experience this problem after committed this patch, please open a new issue for different notices.

AttachmentSize
webform_menu_notices.patch 942 bytes

#23

Status:fixed» closed (fixed)

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