When configuring rules, and selecting an action, i'd like to choose "publish to facebook page" but i get "Unsupported operand types in public_html/includes/form.inc on line 2624" via an ajax call when i pick it.

ideas?

Comments

nally’s picture

Turns out it's happening for all action types. This must be an issue in some other module.

nally’s picture

Project: Facebook Autopost » Rules
Version: 7.x-1.1 » 7.x-2.6
Component: Code » Rules Core
nally’s picture

Here is the code context around that error. 2624 is the $element['#options'] assignment near the end.

I'm wondering whether one of $empty_option or $element['#options'] is somehow NULL, and whether that matters.

  else {
    $required = $element['#required'];
    // If the element is required and there is no #default_value, then add an
    // empty option that will fail validation, so that the user is required to
    // make a choice. Also, if there's a value for #empty_value or
    // #empty_option, then add an option that represents emptiness.
    if (($required && !isset($element['#default_value'])) || isset($element['#empty_value']) || isset($element['#empty_option'])) {
      $element += array(
        '#empty_value' => '',
        '#empty_option' => $required ? t('- Select -') : t('- None -'),
      );
      // The empty option is prepended to #options and purposively not merged
      // to prevent another option in #options mistakenly using the same value  
      // as #empty_value.
      $empty_option = array($element['#empty_value'] => $element['#empty_option']);
      $element['#options'] = $empty_option + $element['#options'];
    }
  }
  return $element;
nally’s picture

It's definitely as issue of $element['#options'] coming up blank. I'm trying to get this to work with Facebook Autopost. Here's a stack trace.


An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /system/ajax
StatusText: OK
ResponseText: array(11) {
[0]=>
array(4) {
["file"]=>
string(44) "<PATH>/public_html/includes/form.inc"
["line"]=>
int(1802)
["function"]=>
string(19) "form_process_select"
["args"]=>
array(3) {
[0]=>
&array(25) {
["#type"]=>
string(6) "select"
["#options"]=>
NULL
["#title"]=>
string(5) "Value"
["#default_value"]=>
NULL
["#required"]=>
bool(true)
["#after_build"]=>
array(1) {
[0]=>
string(38) "rules_ui_element_fix_empty_after_build"
}
["#rows"]=>
int(3)
["#input"]=>
bool(true)
["#multiple"]=>
bool(false)
["#process"]=>
array(2) {
[0]=>
string(19) "form_process_select"
[1]=>
string(17) "ajax_process_form"
}
["#theme"]=>
string(6) "select"
["#theme_wrappers"]=>
array(1) {
[0]=>
string(12) "form_element"
}
["#pre_render"]=>
array(1) {
[0]=>
string(27) "ctools_dependent_pre_render"
}
["#defaults_loaded"]=>
bool(true)
["#tree"]=>
bool(true)
["#parents"]=>
array(4) {
[0]=>
string(9) "parameter"
[1]=>
string(5) "pages"
[2]=>
string(8) "settings"
[3]=>
string(5) "pages"
}
["#array_parents"]=>
array(4) {
[0]=>
string(9) "parameter"
[1]=>
string(5) "pages"
[2]=>
string(8) "settings"
[3]=>
string(5) "pages"
}
["#weight"]=>
int(0)
["#processed"]=>
bool(false)
["#attributes"]=>
array(0) {
}
["#title_display"]=>
string(6) "before"
["#id"]=>
string(35) "edit-parameter-pages-settings-pages"
["#name"]=>
string(33) "parameter[pages][settings][pages]"
["#needs_validation...erInterface"]=>
string(27) "RulesPluginHandlerInterface"
["RulesPluginFeaturesIntegrationInterace"]=>
string(38) "RulesPluginFeaturesIntegrationInterace"
["RulesPluginUIInterface"]=>
string(22) "RulesPluginUIInterface"
}
["facesIncludes":protected]=>
array(1) {
["execute"]=>
array(2) {
["module"]=>
string(18) "fb_autopost_entity"
["name"]=>
string(24) "fb_autopost_entity.rules"
}
}
["facesClassInstances":protected]=>
array(2) {
["RulesAbstractPluginUI"]=>
object(RulesAbstractPluginUI)#202 (2) {
["element":protected]=>
*RECURSION*
["object":protected]=>
*RECURSION*
}
["RulesAbstractPluginDefaults"]=>
object(RulesAbstractPluginDefaults)#233 (2) {
["element":protected]=>
*RECURSION*
["object":protected]=>
*RECURSION*
}
}
}
["element_settings"]=>
array(0) {
}
["parameter_mode"]=>
array(2) {
["publication"]=>
string(8) "selector"
["pages"]=>
string(5) "input"
}
}
}
}
[8]=>
array(2) {
["function"]=>
string(18) "ajax_form_callback"
["args"]=>
array(0) {
}
}
[9]=>
array(4) {
["file"]=>
string(44) "<PATH>/public_html/includes/menu.inc"
["line"]=>
int(517)
["function"]=>
string(20) "call_user_func_array"
["args"]=>
array(2) {
[0]=>
&string(18) "ajax_form_callback"
[1]=>
&array(0) {
}
}
}
[10]=>
array(4) {
["file"]=>
string(36) "<PATH>/public_html/index.php"
["line"]=>
int(21)
["function"]=>
string(27) "menu_execute_active_handler"
["args"]=>
array(0) {
}
}
}
bool(true)
Fatal error:  Unsupported operand types in /<PATH>/public_html/includes/form.inc on line 2626
nally’s picture

Project: Rules » Facebook Autopost
Version: 7.x-2.6 » 7.x-1.1
Component: Rules Core » Code
nally’s picture

I'm also getting "Cannot ask for user accounts without an access token." as an error occasionally at a watchdog style error, as has been mentioned elsewhere. Perhaps this is related to that.

e0ipso’s picture

Is it still happening with other rules actions? If so, then I don't think this is the right place to solve you issue, you will probably need support by the rules team.

e0ipso’s picture

Status: Active » Postponed (maintainer needs more info)
nally’s picture

The problem only occurs when Facebook Autopost Entity is enabled. Can I provide any more specific information? I'll be trying to dig deeper on this.

e0ipso’s picture

@nally thanks!

Please provide as much information as possible so me (or anyone else) can fix this bug.

Thanks for contributing to the issue queue!

nally’s picture

I got past the "Cannot ask for user accounts without an access token." issue. Doing this involved enabling fb_autopost first, and then configuring the FB app BEFORE later adding the entity module.

(Also, in order to get that to work, I needed to take the execution time limit for PHP off as well, as is mentioned in another issue: 2248453)

e0ipso’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Thank you @nally! I hope this fixes it for other people too.