I currently have a menu block set up however it keeps giving me the following fatal error:

PHP Fatal error: Call to undefined function menu_block_configure_form_follow_validate() in /var/www/html/mysite/includes/form.inc on line 1465

I can create and save a menu block, however when I make subsequent changes (such as entering a list of pages), I get the above error.

My modules:

  • Drupal 7.39
  • CTools 7.x-1.9
  • Menu Block 7.x-2.6+1-dev

I see that there is a similar issue: https://www.drupal.org/node/2418803 however I am not using panels which is why I raised a separate issue. Please combine if this is the same issue.

Thank you for your assistance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ajlow created an issue. See original summary.

katokalen2’s picture

Same error here. Using Ctools 1.9, Panels 3.5, Menu Block 7.x-2.7. Can create block fine, it's when I edit and save in blocks admin that I see the same error:

Fatal error: Call to undefined function menu_block_configure_form_follow_validate() in /var/www/drupal/includes/form.inc on line 1465

kailou’s picture

Same error for me as well:
Drupal 7.41
CTools 1.9
Menu Block 7.x-2.7

marcred’s picture

Same here.
I was looking at
https://www.drupal.org/node/1596244
https://www.drupal.org/node/2222543 (applied Ctools 1.6)
https://github.com/backdrop/backdrop-issues/issues/828

Related issues not applicable:
https://www.drupal.org/node/2407951
https://www.drupal.org/node/2417293 (Panopoly_widgets module)

I haven't found a solution. Anyone?

G.I.Joe’s picture

Problem, following functions can not be loaded in the 'menu_block.admin.inc' file:

  • menu_block_configure_form_parent_validate()
  • menu_block_configure_form_follow_validate()

Solution, load 'menu_block.admin.inc' file outside the hook-functions like in the patch.
or, add the functions above in the menu_block.module file.

Status: Needs review » Needs work

The last submitted patch, 5: menu_block-fatal_error_undefined_function-2574457-5-D7.patch, failed testing.

ronaldmulero’s picture

Status: Needs work » Needs review

#5 Works for me.
Drupal core 7.53
Ctools 7.x-1.12
Menu block 7.x-2.7

I could also apply the patch to 7.x-2.x-dev, so don't see why it failed testing.

Jorge Navarro’s picture

kalaiselvann’s picture

Thanks Joe,

#5 Works for me.
Drupal core 7.54

Michael-IDA’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#2521840: Menu Block support

Patch works for me as well against Menu Block 7.x-2.7.

Not saying it's pretty though. Bigger issue is why pulling module_load_include outside of the three functions works. Which leads a surface level eyeball of the change to wonder if it's not ultimately a core issue? form.inc barfs on a lot of stuff...

In any event, this patch is a year plus old, it works, and, as written, it can't cause any detrimental issues (even if core get patched/fixed), so...

Would someone commit it?

joelpittet’s picture

#1596244: block_configure hook does not allow form_state to be altered, which is problematic when modules use includes Made a core patch, though not to wait on that, I'd rather move the functions to menu_block.module

joelpittet’s picture

Status: Reviewed & tested by the community » Needs work
defra_touch’s picture

Solution #5 worked for me as well.

ownage’s picture

The patch in #5 worked for me as well on the latest 7.x-2.7+4-dev.

I was receiving the error with both the latest stable release (and latest unpatched dev) when simply making a checkbox change to "Expand all children of this tree."

joelpittet’s picture

This needs a new patch with the functions moved into menu_block.module as mentioned in #11. The current patch loads that extra file even when the functions aren't called which isn't a good practice for performance.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
11 KB

Ok here's a patch for what I suggested above.

Status: Needs review » Needs work

The last submitted patch, 16: 2574457-16.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
12.78 KB

Fixed CodeSniffer fails

Status: Needs review » Needs work

The last submitted patch, 18: 2574457-18.patch, failed testing. View results

drupal-son’s picture

The patch in #5 (3 years old) worked for me as well on the current latest 7.x-2.8.
#18 didn't work.
Any clue when it will be committed to the next release?

Thanks.