This has happened on a few of my recent upgrade attempts, going from Version 8.5.12 to Version 9.1.3. Everything seems to be working accept images - but some show and other do not. When you edit the page and then edit a particular block, the image reference is present and you can go to files and see the image, but it will not show on the front end after publishing. I have cleared site cache, server cache and browser cache and nothing seems to work. I have deleted an image block and published the page, and then put it back in fresh and published, still not working. The only consistency I can see is it usually on the home page in a hero area, or image slider or special callout box.
(There should be images in all the white boxes. If you edit one, the image reference is there and it even shows the thumbnail, but not in the front end.)
Any assistance would be greatly appreciated as I am banging my head against the wall on this. I have multiple websites to upgrade and this is a problem.
Just a quick FYI your correction is still not totally correct.
The difference between the old way and the new way is you have to tell the method the name of the parameters. In your correction, your false parameters will not be used as you didnât give it its name. It might not impact the result if the parameter is set to false by default for instance.
In your case your are calling this __construct method
<?php
/**
* @param \Concrete\Core\Entity\File\File $f
* @param array|bool|null $options Use NULL to use the default options, a boolean (deprecated) to use a `picture` tag (TRUE) or an `img` tag (FALSE), or an array with these values:
* <ul>
* <li>bool|null `usePictureTag`: TRUE (use a `picture` tag), FALSE (use an `img` tag), NULL or not specified use the settings from the current page theme</li>
* <li>bool|null `lazyLoadNative`: If TRUE the `loading="lazy"` attribute will be added to the `img`</li>
* <li>bool|null `lazyLoadJavaScript`: If TRUE set the img `src` and/or source `srcset` image file path to `data-src` and/or `data-srcset` </li>
* </ul>
*/
public function __construct(File $f = null, $options = null)
{
if (!is_object($f)) {
return false;
}
// rest of the code
}
So your second parameters (false) is named âoptionsâ and without a value, it reverts to default options as explained in the comments.