Jump to content

PW3 - ProcessWire::getArray problem


Gazley
 Share

Recommended Posts

Hi there,

I have the following code:

return array_merge(
$include_fuel ? fuel()->getArray() : array(),
[ 'utils' => $this ],
$this->templateVars
);

This worked fine in PW 2.x

When namespaced to ProcessWire using PW3 either from the original file or, a compiled version, I get the following error:

Error: Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php line 346)

#0 [internal function]: ProcessWire\Wire->___callUnknown('getArray', Array)
#1 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(303): call_user_func_array(Array, Array)
#2 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/WireHooks.php(555): ProcessWire\Wire->_callMethod('___callUnknown', Array)
#3 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(326): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'callUnknown', Array)
#4 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/ProcessWire.php(471): ProcessWire\Wire->__call('callUnknown', Array)
#5 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(327): ProcessWire\ProcessWire->__call('callUnknown', Array)
#6 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(327): ProcessWire\ProcessWire->callUnknown('getArray', Array)
#7 /Applications

I get the same error if I simply call:

fuel()->getArray();

FYI, this is inside a module (called Utils.module).

Can anyone confirm if they see this?

Many thanks.

Link to comment
Share on other sites

Thanks @BitPoet for the reference to the thread. It looks like anyone who was using the Spex module was tripped up by this one. I stopped using Spex a while back and ported most of the ideas to my own module so I had a bit more control over it.

I've got to say, I never really did get the whole "fuel" concept in ProcessWire so if it's now being deprecated, it's one less thing to understand.

Cheers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...