Fatal error: Function name must be a string in /srv/bindings/e1a27851c67c45d1b507c9f7f73dcc2c/code/includes/form.inc on line 1850

Using 7.x-1.x-dev, and I get the above error when I go to /admin/config/content/formats/plain_text (or full_html or any text format).

This results in a "white screen of death". Unfortunately, I can't find the backtrace anywhere in logs...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vitalie’s picture

Hi @jenstechs,

I've saw the bug that duplicated the filter settings form and fixed that. I wonder if that fixed this as well? It's been fixed in latest dev.

anrikun’s picture

It's not fixed in latest dev.

vitalie’s picture

thx, @anrikun, would you be able to provide a backtrace? or any other additional info so that I could replicate it?

anrikun’s picture

Sure @vitalie! This issue is caused by line 104 (and possibly line 111) in spamspan_admin.php:

<?php
    // we need this to insert our own validate/submit handlers
    // we use our own validate handler to extract use_form settings
    $settings['use_form']['#process'] = array(
      array($this, 'settings_form_process'), // Line 104
    );
    return $settings;
  }

  //attach our validation
  public function settings_form_process(&$element, &$form_state, &$complete_form) {
    $complete_form['#validate'][] = array($this, 'settings_form_validate'); // Line 111
    return $element;
  }
?>

#process and #validate expect arrays of strings, not arrays of arrays.
This syntax may work in PHP 5.4 (not tested though) but doesn't in PHP 5.3.
So unless Spamspan drops support for PHP 5.3, this syntax should not be used.

vitalie’s picture

Status: Active » Needs review
FileSize
2.18 KB

thank you @anrikun. Could you please test this patch?

anrikun’s picture

The error is gone for me @vitalie!
But I'd prefer that someone who "uses form" tests it too before this gets "reviewed & tested by the community" as I don't use form myself.

vitalie’s picture

ok, @anrikun, I will let it be for some time, but taking into account that 'uses form' is in essence non-functional in the 7.x-1.2 release, it is most likely that no-one will confirm this in a long time, so I will go ahead and commit after a while.

jennypanighetti’s picture

@vitalie - Does the patch use the syntax above, or did you alter it so that PHP 5.3 is still supported?

vitalie’s picture

@jenstechs it was altered to support php 5.3.

anrikun’s picture

Status: Needs review » Reviewed & tested by the community

@vitalie (#7): in that case, let's commit it now.

  • vitalie committed 5e4639b on 7.x-1.x
    Issue #2444747 by vitalie, anrikun, jenstechs: Fatal error: Function...
vitalie’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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