In Drupal 9.0.2 works Blazy, works Photoswipe, but Blazy PhotoSwipe doesn't work :-/

My error:
Drupal\Core\Security\UntrustedCallbackException: Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was blazy_photoswipe_pre_render. See https://www.drupal.org/node/2966725 v Drupal\Core\Render\Renderer->doTrustedCallback() (line 96 file /DRUPAL/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php).

Comments

martinpetracek created an issue. See original summary.

sakonn’s picture

Confirming the issue on drupal 9.0.5.

sakonn’s picture

Confirming the issue on drupal 9.0.5.

sakonn’s picture

StatusFileSize
new2.17 KB

I have created a patch for this error.
It creates BlazyPhotoswipe class which implements TrustedCallbackInterface.
Then is used this new method for pre_rendering.

mandus.cz’s picture

Thanks for the patch. It works.

timlie’s picture

Status: Active » Reviewed & tested by the community

Can also confirm this patch works.

skin’s picture

Thanks, the patch from works for me

extect’s picture

Priority: Major » Critical

+1 for #4. Solves the issue on D9! Thank you!
Would be great to get this committed soon.

Setting to critical since this issue ends in a WSOD.

gausarts’s picture

Priority: Critical » Normal

Sorry for delay. Hope you are doing well.

This was fixed in DEV and the patch won't apply to DEV branch. I changed and avoided that callback for Drupal 8.7 (lower versions) compatibility:
https://git.drupalcode.org/project/blazy_photoswipe/-/blob/8.x-1.x/blazy...

Hence that is why I set it back to Normal due to Drupal 8.7 compat as otherwise the same WSOD hits 8.7 lower.

Could anyone test the DEV branch so I can release a new branch? I don't have Drupal dev handy now to re-check the DEV branch.
Be sure to clear cache due to this patch or newly introduce function in DEV.

gausarts’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Sorry in case you misunderstood. Don't apply this patch, use the DEV as is, and please report. Thanks.

extect’s picture

Status: Postponed (maintainer needs more info) » Needs review

Sorry, I didn't even know there is a dev release since it is not linked from the modules homepage. However, I can confirm DEV is working nicely on D9, even without the patch.
Since this is causing major issues when not using dev, is there any chance to get a new release oder open a new branch for Drupal >8.7 ?

gausarts’s picture

Status: Needs review » Fixed

@sakonn, the DEV branch already took different direction since Jun last year:
https://www.drupal.org/commitlog/commit/90628/fda49022c4ac30a713131dbf28...

And I cannot revert it to yours, sorry. Appreciated regardless.

Again sorry for delay. Thanks for patience, guys. Have a good day.

Committed.

Status: Fixed » Closed (fixed)

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

sergiy bovdyr’s picture

StatusFileSize
new55.76 KB
new683.8 KB
new1.22 MB

Hello everyone!
I don’t know if I’m writing in the right place, but I think so, because with this module it became possible to use the PhotoSwipe module in the Slick gallery. After the last update on 17-04-2021 of the Slick module and its submodules, the images in the popup are not displayed in their original form, the size is distorted. Before that, everything worked great. Unfortunately, I don't know how to fix this yet.

sergiy bovdyr’s picture

Hello everyone!
I don’t know if I’m writing in the right place, but I think so, because with this module it became possible to use the PhotoSwipe module in the Slick gallery. After the last update on 17-04-2021 of the Slick module and its submodules, the images in the popup are not displayed in their original form, the size is distorted. Before that, everything worked great. Unfortunately, I don't know how to fix this yet.

gausarts’s picture

@Sergiy Bovdyr, please check out solutions here:
https://www.drupal.org/project/blazy_photoswipe/issues/3179924#comment-1...

This thread has nothing to do with your display issue.

sergiy bovdyr’s picture

@Gausarts thanks a lot for the link! I will try again.