Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error when updating php7.2 -> php7.4 (but I found a trick) #211

Open
evertalbers opened this issue Dec 4, 2020 · 1 comment
Open

Comments

@evertalbers
Copy link
Contributor

I ran into an error when updating from php7.2 to php7.4 (which I performed first via the hoster's dashboard)
which also caused me to upgrade from Bolt <3.6 to Bolt 3.7.2 (Bolt 3.6 frontend worked fine on php 7.4, but the backend not so much.

Bob saw the screenshot (attached) and asked me to post it here, sine it looks translate-related.

But: there seems to be a trick when I use 2 steps:

  • when I first switched from php7.2 -> php 7.3 logged into the backend
  • switched from php7.3 -> php 7.4 logged into the backend again, all seems to be going well. (knocks on MDF)

Details

  • Translate Version: [ | 2.X | master ]
  • Bolt Version: [ 2.2 | 3.0 | master ]
  • Used webserver: [ Apache ]

image

@clem
Copy link

clem commented Feb 4, 2021

Hi Evert 👋 ,

I had the same problem but I think I figured out how to fix it 😃

Quick answer

Update the version of Translate, this bug has been fixed in 4.2.2 👌

Long answer

As I had the same issue, I was using the 4.2.1 version.
I tried to bypass the bug by switching PHP versions. It worked from 7.2 to 7.3, but not from 7.3 to 7.4.

After some research, I found the culprit was this $contentType['fields'], because of an incompatible change in PHP 7.4
(see https://www.php.net/manual/en/migration74.incompatible.php - "Array-style access of non-arrays").
Before PHP 7.4, when you used $contentType['fields'] on a null $contentType, PHP returned null.
With PHP ^7.4, it will generates a notice and Bolt throws a ContextErrorException.

After I discovered this, I wanted to create a pull request to fix the bug... But I found it was already merged in #205 🎉

So, you just need to update your version of Translate to the latest (4.2.4 at the time of this comment) and it will fix your issue.

Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants