Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Creating or editing a "Change the author of content" action (which is provided by the Node module) results in a PHP error on form submission. The cause of the error is an invalid parameter in a database query in the action's validation method.
To reproduce:
- On the actions administration page (admin/config/system/actions), choose "Change the author of content…" in the "Create an advanced action" section
- On the resulting configuration page, enter an action label and choose a username
- Submit the form by clicking "Save"
Proposed resolution
- Fix the database query in the validation method so that it uses the correct parameter
- Write tests for administrative configuration of this action
Comment | File | Size | Author |
---|---|---|---|
#2 | adding_or_editing-2667224-2.patch | 4.98 KB | rlhawk |
Comments
Comment #2
rlhawkHere's a patch that fixes the database query in validation and creates tests for configuring this action.
Comment #3
rlhawkChanging version to 8.2.x-dev. Also changing priority to major, since this is core functionality that is completely broken. The "Change the author of content" action cannot be used at all in its current state.
Comment #4
rlhawkComment #5
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedI can confirm this error using commit c9252d07afecbd1704eaf38fd9f47860ea891875.
After applying patch in #2 the created action is created and appears in the list of available actions.
Comment #6
hauruck CreditAttribution: hauruck at UEBERBIT GmbH commentedI can also confirm that the patch from #2 resolves the problem on 8.2.x
Comment #7
lokapujyaComment #8
alexpottAdding a test-only patch is nice so that we can all see that the test is testing what we expect. I've run the test locally without the fix and it fails with the expected error. Nice work.
Committed d93768e and pushed to 8.1.x and 8.2.x. Thanks! This is eligible for 8.1.x as it is a simple bugfix with no BC implications.
I fixed a couple nits on commit.