If the user has a misconfigured filesystem (basically if the webserver cannot file_save_data() correctly), the installation of this module will throw an error:

Fatal error: Call to a member function set() on boolean in /var/www/d8media0/web/modules/contrib/file_browser/file_browser.install on line 20

The reason is that

    $file = file_save_data($data, 'public://file_browser_icon.png', FILE_EXISTS_REPLACE);

not always will work, so $file->set() some lines later will break.

Not sure the best way to deal with this, but perhaps we should check if the file_save_data() is possible in hook_requirements() and only proceed if yes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcoscano created an issue. See original summary.

marcoscano’s picture

Issue summary: View changes
samuel.mortenson’s picture

Wouldn't multiple features in Drupal not work if the web user can't write to public://? I'm wondering if this is out of scope since it's a server configuration problem, but if you submit a patch I'll be happy to review it. :-)

marcoscano’s picture

Sure!
But the whole point here is to avoid WSOD even if the server is misconfigured :)

Attached an approach in hook_requirements.

samuel.mortenson’s picture

Status: Needs review » Fixed

This seems to be working and passed tests, sorry for the late commit!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.