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.

CommentFileSizeAuthor
#22 webform_menu_notices.patch942 bytesquicksketch

Comments

Schneck’s picture

confirmed. subscribing

design.er’s picture

Hello,

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

Stefan

ExJx’s picture

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

tremor’s picture

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

maktub’s picture

same here, subscribing

tremor’s picture

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

quicksketch’s picture

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

quicksketch’s picture

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?

tremor’s picture

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

tharpa.osang’s picture

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

quicksketch’s picture

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.

tharpa.osang’s picture

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

tremor’s picture

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.

tharpa.osang’s picture

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

quicksketch’s picture

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.

sbrandwoo’s picture

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

sbrandwoo’s picture

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.

sbrandwoo’s picture

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

:)

fietserwin’s picture

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,
  );
matt b’s picture

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.

quicksketch’s picture

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.

quicksketch’s picture

Title: Undefined offset errors » Undefined offset errors caused by Webform menu entries
Status: Needs review » Fixed
StatusFileSize
new942 bytes

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.

Status: Fixed » Closed (fixed)

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

sun’s picture

Ah-ha! — that explains why I'm missing a breadcrumb on Webform pages ;)

See #676010: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate() for details on how this can be fixed without callbacks and retaining breadcrumbs.