BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
Fatal Error when trying to save entry
#100 opened by Imp Designs
Description
Fatal error: Uncaught Error: Class 'Psr\Log\NullLogger' not found in /home/leading/production_directory/releases/20180413183751/public/lehp-admin/user/addons/ansel/vendor/ps/image-optimizer/src/ImageOptimizer/OptimizerFactory.php:26 Stack trace: #0 /home/leading/production_directory/releases/20180413183751/public/lehp-admin/user/addons/ansel/addon.setup.php(425): ImageOptimizer\OptimizerFactory->__construct(Array) #1 [internal function]: EllisLab\ExpressionEngine\Core\Application->{closure}(Object(EllisLab\ExpressionEngine\Core\Provider)) #2 /home/leading/production_directory/releases/20180413183751/public/lehp-admin/ee/EllisLab/ExpressionEngine/Core/Provider.php(315): call_user_func_array(Object(Closure), Array) #3 [internal function]: EllisLab\ExpressionEngine\Core\Provider->EllisLab\ExpressionEngine\Core\{closure}(Object(EllisLab\ExpressionEngine\Service\Dependency\InjectionContainer)) #4 /home/leading/production_directory/releases/20180413183751/public/lehp-admin/ee/EllisLab/ExpressionEngine/Service/Dependency/Injecti in /home/leading/production_directory/releases/20180413183751/public/lehp-admin/user/addons/ansel/vendor/ps/image-optimizer/src/ImageOptimizer/OptimizerFactory.php on line 26
Replies
- Imp Designs
Replied 4/17/2018 9:33 AM, Edited 4/17/2018 4:02 PM
Additional Info: I'm able to upload images using the file manager without issue, but my Ansel fields are DOA so far as uploading is concerned. Entry edits save but this error message displays any time I try to save and entry that has content in an Ansel field regardless of whether I try to use the field to upload or choose an existing image.
- Imp Designs
Replied 4/17/2018 9:40 AM, Edited 4/17/2018 4:02 PM
More additional info: Upgrading to EE 4.2.0 didn't fix.
- Imp Designs
Replied 4/17/2018 3:28 PM, Edited 4/17/2018 4:02 PM
Okay...
First test gives: bool(true)
Second test gives: string(24) "composerAutoLoadFilePath"
Third test gives: bool(false)
- TJ Draper
Replied 4/17/2018 3:53 PM, Edited 4/17/2018 4:02 PM
Ugh, not for the first time, I put the comment in the solution text area. I need to work on my admin UI. :P. For posterity, here is what the comment was supposed to be:
I haven't been able to replicate this issue. It seems like maybe some of the files Ansel requires may not have been uploaded?
I would try re-uloading all of Ansel's files to the server. If that fails, here are some debugging steps we can take to see why the logging class is failing to be loaded:
- in
ansel/addon.setup.php
, starting on line 84 is where Ansel determines whether Image Optimization is supported by the PHP version. Can youvar_dump(ANSEL_SUPPORTS_OPTIM); die;
right above that and see what the output is? - If
ANSEL_SUPPORTS_OPTIM
is(bool) true
, right under line 85, let'svar_dump(composerAutoLoadFilePath); die;
and see what the value of that is - Now change that var_dump to
var_dump(is_file($composerAutoLoadFilePath)); die;
and let me know if that's true or false.
Once I can get that information I may (or may not) know how to proceed.
- in
- TJ Draper
Replied 4/17/2018 3:54 PM, Edited 4/17/2018 4:02 PM
I made a typo on the second step. It should be:
var_dump($composerAutoLoadFilePath); die;
Can you dump that line and let me know what it says? It should spit out a server path.
The response on the third step as false is exactly the problem so we need to figure out what's going wrong with getting Ansel's composer autoload path.
- Imp Designs
Replied 4/17/2018 4:00 PM, Edited 4/17/2018 4:02 PM
Ah yes... once again an issue is revealed as being something stupid I've done. Turns out I had a misconfigured .gitignore that was preventing the ansel/vendor/psr/log directory from loading. That kept the NullLogger.php file from being on the server and started all this drama.
Apologies for being a moron.
Ansel Rules!
- TJ Draper
Replied 4/17/2018 4:02 PM
Haha, no problem. You're not a moron, I've done very similar things. Glad we figured it out.