Errors on input forms, can't uninstall, WSOD.

Created on 25 September 2024, about 2 months ago

Problem/Motivation

Hi,

I'm trying to uninstall this module as it is throwing errors on forms where upload fields are present:
Warning: Undefined array key "#upload_validators" in Drupal\file_resup\Form\FileFormAlterBase->formAlter() (line 35 of modules/contrib/file_resup/src/Form/FileFormAlterBase.php).

When I try to run the uninstall process, I am greeted by a message:

file_resup: There is content for the entity type: File Resup. <a href="
  /admin/modules/uninstall/entity/file_resup">Remove file resups</a>.

I can't find this entity type anywhere and when I click on the link I get a WSOD with error:

Error: Call to a member function getFieldStorageDefinition() on null in Drupal\Core\Entity\ContentEntityBase->getEntityKey() (line 1343 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Any insights are greatly appreciated, thanks in advance.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇹🇭Thailand AlfTheCat

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AlfTheCat
  • 🇮🇳India zartab farooquee

    Steps:
    ->Check for Existing Content:

    Run a query in the database to find any content or entities related to file_resup.
    Manually delete any file_resup content if found.

    -> Clear Caches

    -> use the Clean Files Entity module to remove any ghost entities.

    -> Try uninstalling via the admin interface or using Drush.
    drush pm-uninstall file_resup -y

    -> After uninstallation, delete the module files from /modules/contrib/file_resup

    -> Check Drupal logs for details about the error.

    -> Rebuild node access permissions to ensure everything is working.
    drush php-eval 'node_access_rebuild();'

  • 🇹🇭Thailand AlfTheCat

    Hi @zartab farooquee thanks for the guidance. I'll go through these steps.

    One question though, when you mentioned "Manually delete any file_resup content if found" what exactly is that content? It should not be that nodes, for instance, have to be deleted in order for file_resup to be uninstalled, right?

    Does file_resup create entities itself? This part of the errors seems to imply that:

    file_resup: There is content for the entity type: File Resup. <a href="
      

    Thanks again!

  • 🇹🇭Thailand AlfTheCat

    This issue occurs when you switch the field widget from file resup to another widget. When editing an entity that previously used the widget, a string of errors occur:
    Warning: Trying to access array offset on value of type null in Drupal\file_resup\Form\FileFormAlterBase::managedFileProcess() (line 68 of /var/www/***/modules/contrib/file_resup/src/Form/FileFormAlterBase.php)

    Warning: Undefined array key "upload_button" in Drupal\file_resup\Form\FileFormAlterBase::managedFileProcess() (line 68 of /var/www/***/modules/contrib/file_resup/src/Form/FileFormAlterBase.php)

    Warning: Undefined array key "#upload_location" in Drupal\file_resup\Form\FileFormAlterBase::managedFileProcess() (line 59 of /var/www/***/modules/contrib/file_resup/src/Form/FileFormAlterBase.php)

    Warning: Undefined array key "#field_name" in Drupal\file_resup\Form\FileFormAlterBase::managedFileProcess() (line 58 of /var/www/***/modules/contrib/file_resup/src/Form/FileFormAlterBase.php)

    Warning: Undefined array key "#cardinality" in Drupal\file_resup\Form\FileFormAlterBase::managedFileProcess() (line 53 of /var/www/***/modules/contrib/file_resup/src/Form/FileFormAlterBase.php)

    Warning: Undefined array key "#upload_validators" in Drupal\file_resup\Form\FileFormAlterBase::managedFileProcess() (line 52 of /var/www/***/modules/contrib/file_resup/src/Form/FileFormAlterBase.php)

    I've tried to manually disable the module in the database, as Drush cannot uninstall it due to the mysterious file_resup entities, but that doesn't get rid of the errors, strangely enough.

    I think this issue deserves a higher priority since it breaks functionality when changing the widget.

Production build 0.71.5 2024