Problem/Motivation

After deleting a Garden Gnome Package field, cron fails during field
purge:

ValueError: scandir(): Argument #1 ($directory) cannot be empty in 
  scandir() (line 374 of src/GGPackage.php)
  #0 src/GGPackage.php(374): scandir('')
  #1 src/GGPackage.php(360): GGPackage->del_tree(NULL)
  #2 src/Plugin/Field/FieldType/GgnomeField.php(72): GGPackage->deletePackage()
  #3 core/lib/Drupal/Core/Field/FieldItemList.php(237): GgnomeField->delete()
  ...
  #6 core/lib/Drupal/Core/Field/FieldPurger.php(100): purgeFieldData()

When the file entity or the extracted package directory no longer exists,
package_path is empty and del_tree() calls
scandir(''), which throws on PHP 8. Cron aborts on every run and
the field is never purged.

Comments

cezara created an issue. See original summary.

cezara’s picture

Assigned: Unassigned » cezara

  • cezara committed 7dacbefe on 1.0.x
    fix: #3639821 ValueError: scandir(): Argument #1 ($directory) cannot be...
cezara’s picture

Status: Active » Fixed

Fixed: deletePackage() now returns FALSE when the extracted package directory is missing, so field purge on cron no longer crashes. Committed to 1.0.x, will be in 1.0.7.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.