ansel returns a 500 error when trying to use grid data
#48 opened by saturn
Description
getting a fatal error whether there's an image in the field or not. basically acts as if the data is null or corrupt.
PHP Fatal error: Uncaught Error: Call to a member function getUrlSafeParam() on null in /var/www/vhosts/tim/system/user/addons/ansel/Service/AnselImages/ImagesTag.php:368\nStack trace:\n#0 /var/www/vhosts/tim/system/user/addons/ansel/Service/AnselImages/ImagesTag.php(217): BuzzingPixel\Ansel\Service\AnselImages\ImagesTag->setVariablesFromRecord(Object(BuzzingPixel\Ansel\Record\Image))\n#1 /var/www/vhosts/tim/system/user/addons/ansel/Controller/Field/ImagesTag.php(121): BuzzingPixel\Ansel\Service\AnselImages\ImagesTag->getVariables()\n#2 /var/www/vhosts/tim/system/user/addons/ansel/ft.ansel.php(839): BuzzingPixel\Ansel\Controller\Field\ImagesTag->parse(Array, '\n\t<div id="temp...')\n#3 /var/www/vhosts/tim/system/ee/legacy/libraries/api/Api_channel_fields.php(409): Ansel_ft->grid_replace_tag('{"placeholder":...', Array, '\n\t<div id="temp...')\n#4 /var/www/vhosts/tim/system/ee/legacy/libraries/Grid_parser.php(700): Api_channel_fields->apply('grid_replace_ta...', Array)\n#5 /var/www/vhosts/tim/system/ee/legacy/libraries/Grid_parser.ph in /var/www/vhosts/tim/system/user/addons/ansel/Service/AnselImages/ImagesTag.php on line 368
Replies
- saturn
Replied 9/8/2017 12:50 PM, Edited 9/11/2017 6:59 PM
this is the code I've attempted to use:
{t2_top_image} {t2_top_image:image} <div id="template_header"> <!-- Single Header --> <div class="uk-cover-background uk-position-relative" style="background-image: url('{img:url}');"> <img class="uk-invisible" src="{img:url}" width="100%" height="650" alt="{img:title}"> <!-- Optional Text --> <div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle"> <!-- Centered --> <div class="uk-text-center"> {if t2_top_image:cta_text != '' && t2_top_image:cta_url != ''} <a href="{t2_top_image:cta_url}" title="{t2_top_image:cta_text}" class="uk-button uk-button-large">{t2_top_image:cta_text}</a> {/if} </div> </div> </div> </div> {/t2_top_image:image} {/t2_top_image}
- saturn
Replied 9/8/2017 2:09 PM, Edited 9/11/2017 6:59 PM
See ticket from peter@hammerquiststudios.com
We think this is a bug in the file manager in Ansel not syncing with the file manager in EE.
- TJ Draper
Replied 9/8/2017 10:34 PM, Edited 9/11/2017 6:59 PM
Also a duplicate issue of 21, which I clearly have been negligent in addressing. I have, however, spent some time tracking it down and fixing it tonight. The fix will be in a forthcoming release that should be out by Monday at the latest.
That said, I also do recommend trying to make sure source images don’t get deleted as the manipulated image becomes un-editable after the source image is deleted.
I’d also like to point out that Ansel has no file manager so there is no syncing to be done. Ansel is not a file manager, it is only a field type that manipulates images. The only thing I can really do if a source file is deleted is catch errors and not throw them — which is what the fix that is forthcoming will do.
- TJ Draper
Replied 9/11/2017 6:59 PM
Ansel 2.0.10 addresses this issue.