Jump to content
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Peter Knight
      Occasionally when I goto Modules > Upgrades I get the following type of error.
      There's actually about three of them and each one mentions a different line. In the example below, line 266 is
      $new = version_compare($versions[$name]['remote'], $versions[$name]['local']);  
      ( ! ) Notice: Undefined index: local in /Users/peterknight/Sites/mysite.com/site/assets/cache/FileCompiler/site/modules/ProcessWireUpgrade/ProcessWireUpgradeCheck.module on line 266 Call Stack # Time Memory Function Location 1 0.0011 405040 {main}( ) .../index.php:0 2 0.2602 5197688 ProcessWire\ProcessPageView->execute( ) .../index.php:55 3 0.2602 5198064 ProcessWire\ProcessPageView->__call( ) .../index.php:55 4 0.2602 5198064 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 5 0.2603 5198480 ProcessWire\ProcessPageView->_callMethod( ) .../WireHooks.php:733 6 0.2603 5198480 ProcessWire\ProcessPageView->___execute( ) .../Wire.php:383 7 0.3009 5463888 ProcessWire\Page->render( ) .../ProcessPageView.module:209 8 0.3009 5463944 ProcessWire\Page->__call( ) .../ProcessPageView.module:209 9 0.3009 5463944 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 10 0.3015 5465248 ProcessWire\PageRender->renderPage( ) .../WireHooks.php:834 11 0.3015 5465624 ProcessWire\PageRender->__call( ) .../WireHooks.php:834 12 0.3015 5465624 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 13 0.3016 5466040 ProcessWire\PageRender->_callMethod( ) .../WireHooks.php:733 14 0.3016 5466040 ProcessWire\PageRender->___renderPage( ) .../Wire.php:383 15 0.3032 5470760 ProcessWire\TemplateFile->render( ) .../PageRender.module:514 16 0.3032 5470816 ProcessWire\TemplateFile->__call( ) .../PageRender.module:514 17 0.3032 5470816 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 18 0.3033 5471848 ProcessWire\TemplateFile->_callMethod( ) .../WireHooks.php:733 19 0.3033 5471848 ProcessWire\TemplateFile->___render( ) .../Wire.php:380 20 0.3036 5493112 require( '/Users/peterknight/Sites/mysite.com/site/assets/cache/FileCompiler/site/templates/admin.php' ) .../TemplateFile.php:287 21 0.3038 5493616 require( '/Users/peterknight/Sites/mysite.com/wire/modules/AdminTheme/AdminThemeUikit/controller.php' ) .../admin.php:15 22 0.3038 5495120 require( '/Users/peterknight/Sites/mysite.com/wire/core/admin.php' ) .../controller.php:15 23 0.3085 5586144 ProcessWire\ProcessController->execute( ) .../admin.php:135 24 0.3085 5586200 ProcessWire\ProcessController->__call( ) .../admin.php:135 25 0.3085 5586200 ProcessWire\WireHooks->runHooks( ) .../Wire.php:442 26 0.3085 5586616 ProcessWire\ProcessController->_callMethod( ) .../WireHooks.php:733 27 0.3085 5586616 ProcessWire\ProcessController->___execute( ) .../Wire.php:380 28 0.3108 5596744 ProcessWireUpgrade->execute( ) .../ProcessController.php:333 29 1.2224 8773000 ProcessWireUpgradeCheck->getVersions( ) .../ProcessWireUpgrade.module:187 30 1.2227 8776256 ProcessWireUpgradeCheck->getModuleVersions( ) .../ProcessWireUpgradeCheck.module:185 I've been living with it for a while and while it doesn't seem to stop me upgrading etc, I'd love to fix it.
      Anyone recognise this type of error?
    • By DevCat
      Hi,
      I'm trying to install ProcessWire on XAMPP localhost. I extracted the zip and put the files from master folder to website directory folder and when I go there with Firefox it says 404 page not found (no site configuration or install.php available). At least install.php surely is there. I'm doing WordPress installations on localhost almost every day and no problems. Does anyone here know what is cause for this error?
    • 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
×
×
  • Create New...