When I visit /admin/config/content/fancy_file_delete/unmanaged I get the error message:

UnexpectedValueException: RecursiveDirectoryIterator::__construct(sites/default/files/styles/medium/public/product-images): failed to open dir: Permission denied in RecursiveDirectoryIterator->__construct() (line 332 of /vagrant/docroot/sites/all/modules/contrib/fancy_file_delete/fancy_file_delete.module).

Looks like there is a particular folder that it does not have permission to read.

This stackoverflow post seems to suggest that using the LEAVES_ONLY and CATCH_GET_CHILD flags will skip directories that it does not have permission to read however I can't get it to work.

Comments

dahousecat created an issue. See original summary.

smustgrave’s picture

@dahousecat take a look at this patch and see if it works for you.

smustgrave’s picture

Status: Active » Reviewed & tested by the community
smustgrave’s picture

Status: Reviewed & tested by the community » Needs review
smustgrave’s picture

Just following up to see if this has been tested by anyone?

  • smustgrave authored d6f2802 on 7.x-1.x
    Issue #2878394 by smustgrave: Fatal error when permission denied on a...
labboy0276’s picture

Status: Needs review » Fixed

Looks ok to me. I had to manually apply the patch since this issue is older, but thanks!

Status: Fixed » Closed (fixed)

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