When trying to create a variant in foodmenu's the below error occurs, as a consequence no prices can be attached:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /restaurant7/system/ajax
StatusText: OK
ResponseText:
Fatal error: Call to undefined function node_form_submit() in /home/deboezer/public_html/restaurant7/profiles/restaurant/modules/contrib/save_draft/save_draft.module on line 90

Comments

eljay created an issue. See original summary.

shadcn’s picture

Project: Open Restaurant » Restaurant
Version: » 7.x-1.0
Component: User interface » Admin

Moving this to the main issue queue.

shadcn’s picture

Assigned: Unassigned » shadcn
Status: Active » Needs work

Confirmed. I can reproduce the error. Working on a fix.

shadcn’s picture

Status: Needs work » Needs review

Found a fix. @eljay can you please test if the fix below works?

1. Edit /profile/restaurant/modules/restaurant/restaurant_menu.module.
2. Find the restaurant_menu_form_menu_node_form_alter function.
3. Add the following lines to the top of the function.

// Include node.pages.inc.
form_load_include($form_state, 'inc', 'node', 'node.pages');

Your function should look like this:

/**
 * Implements hook_form_FORM_ID_alter().
 */
function restaurant_menu_form_menu_node_form_alter(&$form, &$form_state, $form_id) {
  // Include node.pages.inc.
  form_load_include($form_state, 'inc', 'node', 'node.pages');

  // Get the site language.
  $language = isset($form['language']['#value']) ? $form['language']['#value'] : $form['#node']->language;

  // Hide locations field if restaurant_location module is disabled.
  if (!module_exists('restaurant_location')) {
    $form['field_menu_locations']['#access'] = FALSE;
  }
....

4. Reload the menu form and try adding a variant.

eljay’s picture

@arshadcn,

I confirm that the fix works

thanks

shadcn’s picture

Ok I'll commit and push. Thanks.

  • arshadcn committed 9c978c6 on 7.x-1.x
    Issue #2699333: Ajax error when trying to create a (new) variant in menu...
shadcn’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

shadcn’s picture