Using version: 7.x-2.0-beta2 of State Flow and creating a view with a "State Flow: Event links" field produces the following error and does not provide the appropriate event links.

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in StateFlow->get_event() (line 115 of contrib/state_machine/modules/state_flow/plugins/state_flow.inc).

I'm not sure what this function is expecting but the $key it is receiving is the event name(to draft, publish, etc.) not an integer.

  public function get_event($key) {
  dsm($key, '$key');
    if (!array_key_exists($key, $this->events)) {
      return FALSE;
    }

    if (is_array($this->events[$key])) {
      $options = $this->events[$key];
      $this->events[$key] = new StateFlow_Event($key, $this, $options);
    }

    return $this->events[$key];
  }

Comments

genjohnson’s picture

I am getting the same error with version 7.x-2.0-beta3.

fmitchell’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

genjohnson’s picture

I finally found a moment to apply the patch, and it works great. Thank you!