Undefined properties in the Image block on 9.1.3

I’ve updated a website from 8.5.12 to 9.1.3. Our client wanted to add the image block to a page and it this error below for the following variables:

Undefined property: Concrete\Block\Image\Controller::

For all the missing variables below:

protected $altText;
protected $openLinkInNewWindow;
protected $fOnstateID;
protected $maxWidth;
protected $maxHeight;
protected $internalLinkCID;
protected $fileLinkID;
protected $externalLink;
protected $sizingOption;

So I added all these variable in the class.

And I also had to add $this->set('sizingOption', $this->sizingOption); to the edit() function. And now all of the 9 missing variable errors are gone.

I grabbed another website recently made, which works perfectly, fresh install on 9.1.1 and not updated to 9.1.3 yet. And the files in Concrete\Block\Image\ are identical, so what’s wrong here.

Why doesn’t the exact same code work in 9.1.3 but does in 9.1.1?

I noticed later that after adding 1 image, and then removing the added lines to try and figure out what went wrong, it magically fixed itself.

Weird.

2 Likes

Concrete 9.2 contains a fix for this issue (see Fix PHP 8.2 issues by mlocati · Pull Request #11289 · concretecms/concretecms · GitHub )