Jump to content

Error on upgrade: Error: Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php line 519)


mike62
 Share

Recommended Posts

I am new to ProcessWire; I'm a WordPress developer coming into an existing PW site. I noticed that the site I'm working on is version 2.3 and wanted to upgrade it to the latest version so that I could be sure that the documentation was relevant to me.

I downloaded v2.8.62 Legacy today and followed the upgrade steps. The backend works fine, but the frontend gives me this error message:

Error: Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php line 519)

#0 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(386): Wire->___callUnknown('getArray', Array)
#1 /home/delucaswpg/webapps/delucas_dev/wire/core/WireHooks.php(698): Wire->_callMethod('___callUnknown', Array)
#2 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(442): WireHooks->runHooks(Object(ProcessWire), 'callUnknown', Array)
#3 /home/delucaswpg/webapps/delucas_dev/wire/core/ProcessWire.php(587): Wire->__call('callUnknown', Array)
#4 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): ProcessWire->__call('callUnknown', Array)
#5 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): ProcessWire->callUnknown('getArray', Array)
#6 /home/delucaswpg/webapps/delucas_dev/wire/core/ProcessWire.php(590): Wire->__call('getArray', Array)
#7 /home/delucaswpg/webapps/delucas_dev/site/modules/Spex/Spex.module(163): ProcessWire->_

This error message was shown because: you are logged in as a Superuser. Error has been logged.

The site is hosted on WebFaction and can be found here: http://dev.delucaswpg.webfactional.com. Any help would be greatly appreciated.

-Mike

Link to comment
Share on other sites

Hi mike62 and welcome.

Getting a 500 on your link.

I assume the site was working before the attempted upgrade? And no errors during the upgrade?

What modules are installed (/site/modules/) or Modules > Site in backend? (Might just be an incompatibility there.)

Tracy debugger is highly recommended. If PW backend is functional it may be well worth installing.

<edit>I just noticed Spex in the error messages - this thread may be relevant.</edit>

 

Link to comment
Share on other sites

4 minutes ago, abdus said:

Try uninstalling Spex. Error seems to be originating from it

Will probably break something else, but the other thread I linked to above was related to Spex. Unfortunately, that module's author hasn't been around since early 2016, it looks like.

It might just be that the fix in the other thread works for you (fingers crossed).

  • Like 1
Link to comment
Share on other sites

I updated Spex — from 0.2 (!) to 0.99 — and still get this error:

Error: Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php line 519)

#0 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(386): Wire->___callUnknown('getArray', Array)
#1 /home/delucaswpg/webapps/delucas_dev/wire/core/WireHooks.php(698): Wire->_callMethod('___callUnknown', Array)
#2 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(442): WireHooks->runHooks(Object(ProcessWire), 'callUnknown', Array)
#3 /home/delucaswpg/webapps/delucas_dev/wire/core/ProcessWire.php(587): Wire->__call('callUnknown', Array)
#4 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): ProcessWire->__call('callUnknown', Array)
#5 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): ProcessWire->callUnknown('getArray', Array)
#6 /home/delucaswpg/webapps/delucas_dev/wire/core/ProcessWire.php(590): Wire->__call('getArray', Array)
#7 /home/delucaswpg/webapps/delucas_dev/site/modules/Spex/Spex.module(250): ProcessWire->_

This error message was shown because: you are logged in as a Superuser. Error has been logged.

When I removed Spex I got loads of "function doesn't exist" errors for the page templates, so it looks like this template is relying on it pretty heavily. :(

  • Like 1
Link to comment
Share on other sites

Getting somewhere! Now I have just this error:

Compile Error: require(): Failed opening required '/home/delucaswpg/webapps/delucas_dev/site/templates/layouts/portal.php' (include_path='.:/usr/local/share/pear54') (line 186 of /home/delucaswpg/webapps/delucas_dev/site/modules/Spex/Spex.module) 

This error message was shown because: you are logged in as a Superuser. Error has been logged.

When I go to line 186 of that file, it reads like so:

require $config->paths->templates.'layouts/'.$this->layout.'.php';

That pear54 thing... does that have to do with my hosting environment?

 

EDIT: Actually I just noticed that I don't have a /site/templates/layouts/ folder, but rather a /site/templates/layout/ folder. I tried renaming it to /layouts/... but now I'm back to these errors:

Error: Exception: Method Spex::includeStyles does not exist or is not callable in this context (in /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php line 519)

#0 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(386): Wire->___callUnknown('includeStyles', Array)
#1 /home/delucaswpg/webapps/delucas_dev/wire/core/WireHooks.php(698): Wire->_callMethod('___callUnknown', Array)
#2 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(442): WireHooks->runHooks(Object(Spex), 'callUnknown', Array)
#3 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): Wire->__call('callUnknown', Array)
#4 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): Spex->callUnknown('includeStyles', Array)
#5 /home/delucaswpg/webapps/delucas_dev/site/templates/layouts/_base.php(27): Wire->__call('includeStyles', Array)
#6 /home/delucaswpg/webapps/delucas_dev/site/templates/layouts/_base.php(27): Spex->includeStyles()
#7 /home/delucaswpg/webapps/delucas_dev/site/modules/Spex/Spex.module(192): require('/home/delucasw

This error message was shown because: you are logged in as a Superuser. Error has been logged.

I see now it's referring to line 192 of Spex.module. Which is this:

require $config->paths->templates.'layouts/'.$this->baseLayout.'.php';

Does that move us forward at all?

Edited by mike62
Link to comment
Share on other sites

Hmm. I guess from Spex 0.2 to 0.99 breaking changes happened, and includeStyles() method does not exist anymore. There's addStyle() method, maybe changing includeStyles() to addStyle() may work. But I fear there are more of these breaking changes.

Link to comment
Share on other sites

Interesting. I replaced some of those functions with their new counterparts, and now the page is loading without errors, but it is not loading properly... http://dev.delucaswpg.webfactional.com 

I may have to just "leave well enough alone" and stick with my 2.3 installation... and muddle my way through making the changes — with documentation that is not correct for the version I'm using. Fun times. :(

I really do appreciate you guys taking the time to try to help me figure this out though! Definitely a big help. Thank you.

  • Like 1
Link to comment
Share on other sites

5 minutes ago, mike62 said:

I may have to just "leave well enough alone" and stick with my 2.3 installation

I was just typing something along those lines when you posted. It's either that, or fix Spex, or refactor the whole site not to need Spex. (I figured out where the live site is, and I'm guessing that refactoring isn't actually an option.)

10 minutes ago, mike62 said:

and muddle my way through making the changes — with documentation that is not correct for the version I'm using

You might find that the core PW stuff in the working version is still covered in the docs, since stuff is rarely (never?) deprecated completely, just new stuff added, and there isn't the imperative with PW to upgrade like you might be used to with WP.

You can always come back here for advice - we usually try to help when we can. 

  • Like 1
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

×
×
  • Create New...