mike62

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)

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

Share this post


Link to post
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>

 

Share this post


Link to post
Share on other sites

Thanks Dave! I've attached a screenshot of the Site modules. I installed Tracy Debugger, but I'm not sure how to get any useful info out of it. After I installed it, the error message changed to this (see second attachment). 

Screen Shot 2017-09-08 at 12.20.29 PM.png

Screen Shot 2017-09-08 at 12.24.06 PM.png

Share this post


Link to post
Share on other sites

Try uninstalling Spex. Error seems to be originating from it

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Top detective work @abdus!

1 minute ago, abdus said:

Updating the module may fix the issue.

It's worth a try.

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Try changing fuel() to $this->fuel() or wire()->fuel() on line 250 in /site/modules/Spex/Spex.module

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks Dave! I really appreciate all your help. I may be back... just might be tough working on PW 2.3 and Spex 0.2... Hopefully I can muddle my way through. :S 

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By sam-vital
      Hi,
      So I'm working on my site, getting round to completing it. I remember that I haven't checked at all what it will be like on other devices, so that's my next task.
      I went to the index page and I get hit with this error:
      Fatal error: Exception: SQLSTATE[HY000] [2002] Connection refused (in /var/sites/b/mysite.org/public_html/wire/core/ProcessWire.php line 377) #0 /var/sites/b/mysite.org/public_html/wire/core/ProcessWire.php(209): ProcessWire\ProcessWire->load(Object(ProcessWire\Config)) #1 /var/sites/b/mysite.org/public_html/index.php(52): ProcessWire\ProcessWire->__construct(Object(ProcessWire\Config)) #2 {main} in /var/sites/b/mysite.org/public_html/index.phpon line 64
      All I have done from the last code update was change a links target to blank, pushed the update and tested it. Now my site is broken? Went back and changed to the original file and I'm still getting the error.
      I really don't understand what has happened. I am an ok {6 months} web developer with this being my first experience of PW.
      All help is appreciated 🙂
    • By BFD Calendar
      I'm still wrestling with the upgrade troubles on OVH.com hosting. I manually upgraded to PW 3.0.98 and Upgrade module 0.0.7. Checking upgrades gives me an "Error loading GitHub branches - https://api.github.com/repos/processwire/processwire/branches - HTTP error(s): 2: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version, 2: fsockopen(): Failed to enable crypto, 2: fsockopen(): unable to connect to ssl://api.github.com:443 (Unknown error) - Check that HTTP requests are not blocked by your server.".
      Upgrading or installing other modules doesn't work either. I know it probably has to do with some provider setting on OVH.com, but I've tried several things mentioned in the ProcessWireUpgrade support forum, all to no avail. Server is configured to use PHP 7.0. If anyone here is also on OVH.com and knows a solution I'd be most happy to hear about it.
    • By Sergio
      All of a sudden, with nothing changed on the database or server, a website was getting error when doing a search:
      Error: Exception: SQLSTATE[HY000]: General error: 23 Out of resources when opening file './your-database-name/pages_parents.MYD' (Errcode: 24 - Too many open files) (in /home/forge/example.com/public/wire/core/PageFinder.php line 413) #0 /home/forge/example.com/public/wire/core/Wire.php(386): ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors), Array) #1 /home/forge/example.com/public/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___find', Array) #2 /home/forge/example.com/public/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'find', Array) #3 /home/forge/example.com/public/wire/core/PagesLoader.php(248): ProcessWire\Wire->__call('find', Array) #4 /home/forge/example.com/public/wire/core/Pages.php(232): ProcessWire\PagesLoader->find('title~=EAP, lim...', Array) #5 /home/forge/example.com/public/wire/core/Wire.php(383): ProcessWire\Pages->___find('title~=EAP, lim...') #6 /home/forge/example.com/public/wire This error message was shown because: you are logged in as a Superuser. Error has been logged.  
      I tried several things, listed in this thread: https://serverfault.com/questions/791729/ubuntu-16-04-server-mysql-open-file-limit-wont-go-higher-than-65536
      But for some reason, MySQL was not getting its limit increased, but in the end, the one that did the trick was this:
      This worked for me on Ubuntu Xenial 16.04:
      Create the dir /etc/systemd/system/mysql.service.d
      Put in /etc/systemd/system/mysql.service.d/override.conf:
      [Service] LimitNOFILE=1024000 Now execute
      systemctl daemon-reload systemctl restart mysql.service Yes indeed, LimitNOFILE=infinity actually seems to set it to 65536.
      You can validate the above after starting MySQL by doing:
      cat /proc/$(pgrep mysql)/limits | grep files
    • By phillipschmitz
      500 Error after the latest Core Update.
      I have no idea why and what causes the problem, or how to solve it. (Maybe reupload the wire folder?)

       

      Any ideas? 
    • By louisstephens
      So I recently upgraded my sandbox environment to the latest master version from .62(?). I logged in and received the following error:
      "There appear to be multiple copies of module "AdminThemeUikit" on the file system."
      Unfortunately, in my haste, I removed the theme from site->modules so it doesnt exist anymore, and the theme has defaulted somewhat to the old theme. Is there a way to restore UIkit as the theme for processwire natively, or do I need to completely re-install?