getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

Home Page:https://getgrav.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't upgrade from v1.6.26 to v1.7.32

q-depot opened this issue · comments

Hi,

I currently run php 7.1, I can't upgrade grav to 1.7 unless I upgrade to php 8, however when I do that grav stops working, I get an error in a dependency, it's something to do with "match" being reserved in php8.

`
willdurand/negotiation/src/Negotiation/Negotiator.php

return new Match($accept->getQuality() * $priority->getQuality(), $score, $index);`

You're getting the error because of the line should be like this in the latest Grav:

return new AcceptMatch($accept->getQuality() * $priority->getQuality(), $score, $index);

Do you have a plugin that has an older version of this library? Maybe turn off extra plugins before updating.

Oh, I get, you update to PHP 8 before updating Grav?

yes that's the problem, in order to upgrade grav I need to upgrade to php8 but that in turn breaks grav so I can't upgrade.

I tried to deactivate the plugins and that didn't work, I reckon this is a dependency in grav?

Can you upgrade to 7.4 first. Then upgrade grav to latest. Don’t need 8+ although it does have some good speed improvements.

I don't think there's a way to do the update from admin or CLI, but what you can do is to keep those plugins disabled and install the Grav update package by hand: just unzip all the files over the existing ones. I wouldn't use the latest version as the installer does clean some old files, but you can likely go for a recent version and then do another update from admin (or CLI) to clean things up.

https://github.com/getgrav/grav/releases/tag/1.7.30 <- you could use this for example, grav-update-v1.7.30.zip

@rhukster it works, thank you so much!

These are the steps I've followed:

  • Upgrade to PHP 7.4
  • Upgrade Grav to 1.7.32
  • Upgrade all plugins
  • Upgrade to PHP 8.0

Haha, good point, I assumed you cannot do incremental updates.

I'm going to update learn site to include a note from this.

To be fair I could do it because I'm on Cloudways, it's super easy to change PHP version, you just need to select it from a dropdown menu.