-
Notifications
You must be signed in to change notification settings - Fork 40
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
Error: Call to a member function init() on null in view->init_localization() on updating core (latest release) #4626
Comments
Here's a PR that catches the problem. To test it, follow the steps in the issue description. |
I think it looks good I'll test later. Wondering when it'll actually ever be "none"? Maybe that part isn't working? |
That's an admin setting. Localization can be turned off on admin/structure/views/settings/advanced In rare cases no localization_plugin is available (file not included) - which leads to the error. |
Code looks good, but there's punctuation missing in the inline comments, and they wrap into the next line while more words still fit. Testing on my local next... |
Where?
One full sentence per line - for readability. (That a comment line may not be longer than 80 chars doesn't mean is has to be at least 80 chars. 😉 ) |
I'll add comments with suggestions in the PR ...but mostly conditional clauses.
Nope. That's been widely used by some devs (the Views module is a huge offender of that), but it's against both Drupal and Backdrop standards. See https://api.backdropcms.org/doc-standards#general (emphasis mine):
|
Means: not longer - but shorter is not forbidden. |
^^ this means "not longer"
^^ this means "fit as many words as possible" (in the same line) |
I disagree but did it. |
Don't forget to actually test the PR... 😄 |
Yup, I'm doing that now... 😅 |
...OK, here's what I did:
Then:
|
Thanks for putting up with my pedantic PR comments re code standards compliance and grammar rules re punctuation @indigoxela 🙏 ...this is now RTBC. |
...and too late for 1.17.1 or 1.16.4 So this fix probably isn't urgent anymore. 😞 |
Thanks @indigoxela, @klonos & @herbdool. I've merged backdrop/backdrop#3315 into 1.x and 1.17.x. |
Description of the bug
This already did pop up in another issue while testing the preview release, but we missed the actual root cause.
Steps To Reproduce
Actual behavior
Error: Call to a member function init() on null in view->init_localization() (line 2009 of .../core/modules/views/includes/view.inc).
Expected behavior
No error, of course.
Many people probably run the updater immediately after replacing files, but others may not and the site shouldn't look broken then - even if flushing caches fixes the problem.
People who are running core updates via UI won't get that error, neither people who run
drush updb
orb updb
right after replacing files.Additional information
It's too late for the 1.16.3/1.17.0 releases, but we could fix it for people who didn't update yet.
Possibly by catching it in function init_localization() - if $this->localization_plugin is still NULL, return instead of trying to act on it?
The text was updated successfully, but these errors were encountered: