Jump to content
davo

ProcessWire 2.8.33 upgrade

Recommended Posts

Hi

I'm about to prepare to do an upgrade from ProcessWire 2.8.33 to 3.0.39. Has anyone experience any complications or issues that  I should be aware of?

 

Davo

Share this post


Link to post
Share on other sites

Well, most important thing is the compiler/namespace feature:

https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/

or in more detail: https://www.google.hu/search?as_sitesearch=processwire.com%2Fblog&as_q=recipe#q=namespace+site:processwire.com%2Fblog

Non core/Ryan modules might fail, so it is recommended to read up on them too. And most importantly I would certainly clone it to a dev environment and upgrade that instance of the site firts, just to see what actually happens....

  • Like 2

Share this post


Link to post
Share on other sites

I gave the upgrade to 3 a go today, but i'm hitting a couple of problems.

I have a functions file but when it is called from in a template I get this error:

Error: Call to undefined function wire() (line 155 of /var/www/vhosts/dudmc.com/httpdocs/site/templates/myfunctionlib.inc)

Do I have to amend anything to make this work again?

Share this post


Link to post
Share on other sites

I made a branch of our site that has the PW3 upgraded running on PHP7 (current site runs on PW2.5.x and PHP 5.5/5.6).

These are the things I had to change to get it working, but your mileage may vary slightly depending on which core functions you've used.

  • wire(page)  ->  \Processwire\Wire("page")
  • wire(pages)  ->  \Processwire\Wire("pages")
  • wire(config) ->  \Processwire\Wire("config")
  • wire(sanitizer) ->  \Processwire\Wire("sanitizer")
  • \PageArray() -> \Processwire\PageArray()

Share this post


Link to post
Share on other sites

If you have the filecompiler turned on, you usually shouldn't have to do anything to upgrade from 2.x to 3.x. If you don't want to use it, all you should have to do is add:

namespace ProcessWire;

at the top of your template files. Generally there should be no need to prepend all wire() calls like that.

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

If you have the filecompiler turned on, you usually shouldn't have to do anything to upgrade from 2.x to 3.x. If you don't want to use it, all you should have to do is add:


namespace ProcessWire;

at the top of your template files. Generally there should be no need to prepend all wire() calls like that.

Does this work if you're using multiple namespaces on your project?
 I couldn't get it to work otherwise ....

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.

×
×
  • Create New...