Jump to content

ProcessWire 2.8.33 upgrade


davo
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
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()
Link to comment
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
Link to comment
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 ....

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...