Error in DevelopmentOutput when not-yet-installed add-on dir has wrong permissions

pegasus

Well-known member
Affected version
2.2.8
I just had a very confusing error where \XF\DevelopmentOutput $metadataCache and $typesLoaded became desynchronized, which appeared illogical according to its code, and resulted in the add-ons list being completely inaccessible:

ErrorException: [E_WARNING] Undefined array key "templates" src/XF/DevelopmentOutput.php:250

This occurred because I had just uploaded a new addon directory in src/addons and the file permissions were incorrect immediately after uploading (according to other messages in Server Error Logs).

This occurs because the method getAvailableAddOnIds() does not check whether a newly discovered add-on directory is readable before attempting to iterate into it. We get "thrown" out after $typesLoaded is populated, but before $metadataCache is, resulting in a desynchronized cache for the next time we need to check the contents of $metadataCache.
 
Top Bottom