Problem/Motivation

After updating our site from 3.0.0 to 3.0.1, going to /admin/people results in the following error:

The website encountered an unexpected error. Try again later.<br><br><em class="placeholder">Drupal\Component\Plugin\Exception\PluginNotFoundException</em>: The &quot;immediate_delete&quot; plugin does not exist. Valid plugin IDs for Drupal\Core\Action\ActionManager are: file_delete_immediately, file_delete_mark_temporary, node_unpromote_action, node_promote_action, node_make_sticky_action, node_make_unsticky_action, redirect_delete_action, user_add_role_action, user_block_user_action, user_cancel_user_action, user_remove_role_action, user_unblock_user_action, vbo_cancel_user_action, views_bulk_operations_delete_entity, webform_submission_make_unlock_action, webform_submission_make_unsticky_action, webform_submission_delete_action, webform_close_action, webform_open_action, webform_submission_make_lock_action, webform_archive_action, webform_unarchive_action, webform_submission_make_sticky_action, webform_delete_action, state_change:block_content__approved_to_go_live, state_change:block_content__draft, state_change:block_content__needs_approval, state_change:block_content__published, state_change:block_content__unpublished, state_change:media__approved_to_go_live, state_change:media__draft, state_change:media__needs_approval, state_change:media__published, state_change:media__unpublished, state_change:node__approved_to_go_live, state_change:node__draft, state_change:node__needs_approval, state_change:node__published, state_change:node__unpublished, state_change:paragraph__approved_to_go_live, state_change:paragraph__draft, state_change:paragraph__needs_approval, state_change:paragraph__published, state_change:paragraph__unpublished, state_change:taxonomy_term__approved_to_go_live, state_change:taxonomy_term__draft, state_change:taxonomy_term__needs_approval, state_change:taxonomy_term__published, state_change:taxonomy_term__unpublished, pathauto_update_alias, entity:delete_action:media, entity:delete_action:node, entity:delete_action:webform, action_send_email_action, action_goto_action, action_message_action, entity:publish_action:block_content, entity:publish_action:media, entity:publish_action:node, entity:publish_action:paragraph, entity:publish_action:path_alias, entity:publish_action:redirect, entity:publish_action:taxonomy_term, entity:publish_action:menu_link_content, entity:save_action:block_content, entity:save_action:file, entity:save_action:link_to_subject_and_geo, entity:save_action:media, entity:save_action:node, entity:save_action:role_watchdog, entity:save_action:taxonomy_term, entity:save_action:user, entity:save_action:menu_link_content, entity:unpublish_action:block_content, entity:unpublish_action:media, entity:unpublish_action:node, entity:unpublish_action:paragraph, entity:unpublish_action:path_alias, entity:unpublish_action:redirect, entity:unpublish_action:taxonomy_term, entity:unpublish_action:menu_link_content in <em class="placeholder">Drupal\Core\Plugin\DefaultPluginManager-&gt;doGetDefinition()</em> (line <em class="placeholder">53</em> of <em class="placeholder">core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php</em>).

Steps to reproduce

Update from 3.0.0 to 3.0.1
Run drush updb
Login as an admin
Go to /admin/people

Proposed resolution

The update hook file_delete_update_400004() ran but after debugging it I can see that it didn't make any changes. The following config is trying to be loaded but does not exist:

action.system.action.mark_file_for_deletion
action.system.action.immediate_delete

The config in this site is named:
system.action.mark_file_for_deletion
system.action.immediate_delete

(it doesnt start with action.)

Remaining tasks

Decide how to fix this and then create another update hook that fixes it.

CommentFileSizeAuthor
#12 3567720.patch4.76 KBdioni
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nicrodgers created an issue. See original summary.

svicer’s picture

Confirmed. There's a second bug in the same hook:

  1. Wrong config names (as reported): action.system.action.* → should be system.action.*
  2. Wrong field: Updates id but should update plugin

Silent failure because getEditable() with non-existent config returns empty object, $config->get('id') returns NULL, condition is false.

nicrodgers’s picture

Priority: Normal » Critical

Hi @svicer thanks for looking at this. I have tested your MR and confirm that it does fix the problem when updating from 3.0.0 to 3.0.1.
However I think we'll need to increase the update hook number to file_delete_update_400005 because some people may have already run file_delete_update_400004 after updating to 3.0.1.

If we can get this RTBC hopefully we can then get a 3.0.2 releaes out ASAP. Bumping the priority to Critical due to the upgrade from 3.0.0 to 3.0.1 being broken.

robert-arias made their first commit to this issue’s fork.

robert-arias’s picture

Bumped the update hook sequence and removed the faulty update hook. Not sure if you wanted to keep it just for record sake!

nicrodgers’s picture

Status: Active » Needs work

Thanks Robert. I think we should keep file_delete_update_400004() but remove the code from within it, and add/update a comment explaining that it's been removed as it was faulty and replaced with 400005.

nnevill made their first commit to this issue’s fork.

nnevill’s picture

Status: Needs work » Needs review

I've updated the MR, but it's important not to run drush deploy but run drush updb & drush cex -y before

nicrodgers’s picture

Thank @nnevil.

I've made a tiny change to the comment in the update hook to shorten it, so that phpcs is happy.
I'll leave it as Needs Review for someone else to approve.

alexander tallqvist’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the MR!

I tested MR21 on file_delete module version 3.0.1 with Drupal 11.2.10 and can confirm that visiting /admin/people no longer produces a fatal error.

After installing the patch, running database updates and exporting the configuration correctly updates:

system.action.immediate_delete.yml

system.action.mark_file_for_deletion.yml

Setting to RTBTC!

dioni’s picture

StatusFileSize
new4.76 KB

Tested and working as expected.

Adding the MR as patch file.

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Status: Reviewed & tested by the community » Needs review

Don't think we should remove an old hook, so I put that back. Moving to NR for a quick check and can merge.

  • smustgrave committed 1f9c12c1 on 3.0.x authored by svicer
    Issue #3567720: Fix file_delete_update_400004 config names and field
    
smustgrave’s picture

Status: Needs review » Fixed

Actually nvm

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.

Status: Fixed » Closed (fixed)

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