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.
After writing a new article and publishing it i can't change the author of the the article afterwards.
This happened after a fresh installation with the following core modules activated:
Blog
Forum
Poll
Content translation
Profile
Comment | File | Size | Author |
---|---|---|---|
#6 | node_author_update.patch | 1.13 KB | bleen |
#1 | node_author.patch | 859 bytes | marcingy |
Comments
Comment #1
marcingy CreditAttribution: marcingy commentedIf an attempt is made to amend an author it will fail because of this piece of logic
In that an existing node will always fail the second part of the if statement. D6 makes no check at all except for user_access which in theory could see a node assigned to uid = 0. My intial thoughts are that we should split out the if statement into 2 checks so as if we don't find a name we don't overwrite the existing uid. Patch attached.
Comment #2
marcingy CreditAttribution: marcingy commentedOn second thought this really is critical as the idea that a node can never change ownership after creation is a pretty fundamental flaw.
Comment #3
zenith.thepeak CreditAttribution: zenith.thepeak commentedyeah, i have tried the code and i am able to Change the Author name.
Its working
Comment #4
int CreditAttribution: int commentedThe "Assigned to", is to tell that person is working in one patch, and not testing.
Comment #5
bleen CreditAttribution: bleen commented...and the issue title should describe the problem (even after a potential fix has been identified)
Comment #6
bleen CreditAttribution: bleen commenteda) the patch in #1 needs to be created relative to the root of the Drupal install (not modules/node). I rerolled the patch from #1 to reflect this
b) the patch seems to fix the problem - woohoo!!!
c) I am concerned about this line in the comments above the lines being patched though:
What "other means"? If contrib modules (for example) are assigning a $node->uid, but not a $node->name then this change will cause that to stop working. I can imagine "devel generate" might do this. Gonna check... but I'd love to hear from someone else on this. I may be completely wrong here.
Comment #7
matt2000 CreditAttribution: matt2000 commentedI created this bug in #398110: node_submit resets $node->uid ... sorry... It was first reported there. Moshe makes the solution clear in the comments: node_submit needs to go away completely. I've been meaning to write the patch, but haven't got to it yet.
Comment #8
Dries CreditAttribution: Dries commentedIf this code is correct, the PHP comment directly above should be updated.
Comment #9
matt2000 CreditAttribution: matt2000 commentedThe PHP comment is removed in the new patch provided in the original issue queue.
Comment #10
David_Rothstein CreditAttribution: David_Rothstein commentedLooks like this was all fixed by the latest commit at #492186: Authoring information is never updated., although the bug report here was older.