Problem/Motivation

After updating to 8.12, I'm getting Error: Call to a member function get() on null in Drupal\blazy\BlazyFormatter->preBuildElements() (line 61 of /var/www/html/web/modules/contrib/blazy/src/BlazyFormatter.php) on certain pages. Not sure what exactly is causing this but I know how to prevent it and will provide a patch in a minute.

CommentFileSizeAuthor
#15 3282785-WSOD-15.patch605 bytesgausarts
#14 3282785-14.patch1.31 KBrajab natshah

Issue fork blazy-3282785

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
michèle’s picture

#2 fixes the issue. thank you!

trickfun’s picture

Sorry for my stupid question but how can use the patch with composer?

gausarts’s picture

Thank you.

Alternative solution to avoid this WSOD without the patch is to install the latest sub-modules accordingly, e.g.:
https://www.drupal.org/project/slick/releases/8.x-2.7-beta1

Regarding patch, the $plugin_id will be undefined here:
https://git.drupalcode.org/project/blazy/-/merge_requests/10/diffs?commi...

Feel free to update your patch if you'd like to add another check to avoid that warning.

I'll get back to it shortly, and release another one. Thanks again.

UPDATED
Added a new beta for testers.

anybody’s picture

Confirming the issue with 8.x-2.12! MR!10 fixes it, but raises:

Warning: Undefined variable $plugin_id in Drupal\blazy\BlazyFormatter->preBuildElements() (line 66 of modules/contrib/blazy/src/BlazyFormatter.php).

anybody’s picture

The warning should now also be fixed. Please review and create a hotfix release as soon as possible. Thanks :)

quotientix’s picture

+1 - experiencing the same WSOD

gausarts’s picture

Thinking this over we should probably supply
Blazy::verify($settings);
at the top, and remove the current checks/ patch.

Like everywhere else during this transition.

This way, it will facilitate, not negate, the feature. Might be useful for potential third tier sub-modules like EZ Plus, SB, etc.

And please allow some delay to get back to it. I thought I could make it shortly, but not. I am sorry about it.

For immediate solution without patches, please see #6.

rajab natshah’s picture

Facing the same issue.
Using the following patch link from the MR commit
https://git.drupalcode.org/project/blazy/-/commit/41feec129ab1c60c90d77a...
This is for the dev branch

anybody’s picture

@gausarts: Thank you for your quick reaction. Just an idea to save you from further WSOD reports and users from frustration, wouldn't it make sense to create a hotfix release with the MR to make it at least "work" without error until there is a clean solution?

The solution from #6 also requires manual interaction. Everyone doing typical "composer update" will crash its project and come to this issue... that's quite a heavy thing.

I guess then you'll have all the time it needs to fix this and the priority can be reduced?

As a result composer update should just work.

PS: It was a stable release killing the sites... so I think this is critical for up to 50.000 sites? ;)

(REALLY No offense, just my two cent, such things can happen to everyone of us and this is open source :) So THANK YOU however you decide.)

"with great power comes great responsibility"

drupalfan2’s picture

Same error here (8.12):

Error: Call to a member function get() on null in Drupal\blazy\BlazyFormatter->preBuildElements() (Zeile 61 in /var/www/html/web/modules/contrib/blazy/src/BlazyFormatter.php)

rajab natshah’s picture

StatusFileSize
new1.31 KB

Thank you, Jürgen (jurgenhaas), and Julian (Anybody) for the quick fix

Only having the merge_requests/10.diff as 3282785-14.patch, as the 10.diff file keeps changes by each commit on the issue fork.

For a quick use patching on the 2.12 release and the dev branch

gausarts’s picture

Component: Code » Regression
StatusFileSize
new605 bytes

Thank you.

As I don't want to change it back after being released, here is as described at #10 -- to facilitate not negate.

  • gausarts committed afebe69 on 8.x-2.x
    Issue #3282785 by jurgenhaas, Anybody, gausarts, Rajab Natshah: WSOD...
gausarts’s picture

Status: Needs review » Fixed
Related issues: +#3257511: Optimization pre Blazy 3

To avoid this type of potential repeated issue, please read project home warning, or here for convenience:

Apologies!

Releases 2.6 - 2.9+ were buggy due to this WIP: #3257511: Optimization pre Blazy 3.

Please stick to 2.5 (with 2 non-major bugs) till further fixes and dev storms subsided.

If you are insistently using the latest, which is cautiously fine so we can have more testers and move forward faster, please make sure Blazy sub-modules are updated to their latest as well to avoid disruptions or errors due to potential oversights. Blazy has been moving forward very fast since 2.6 to have an initial 3.x for D11+ onward compatibility, it might forget to look back.

You have been warned very friendly and apologetically, in fact since 1.x here about the importance of matching branch, version or closest date releases.

It is a contrib, not core, with very limited resources, and contributions. At least this issue would not happen if contributions were happening at DEV phases, not just RELEASE ones. That is fine, I know anybody are busy in this very short life. But kindly bear with and accept such limitations.

Thanks to those who are showing cool manners on this critical issue. You are awesome.
And again all apologies for inconveniences.

May you all be blessed with happy, healthy and good living :)

Committed. Again thank you all for contributions.

anybody’s picture

Thank you very much for your great work on this great project and the fix in this issue. Completely agree :)
There's a good reason why > 60.000 projects use it: It's super awesome and helpful, you can be really proud. Things like these happen, while we all try to prevent it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.