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.
Publishing options seem to be copied correctly when using the "Save as a new node then edit" method, but are not copied correctly when using the "Pre-populate the node form fields" method. I'll try to track down the issue and post a patch if I can.
Comment | File | Size | Author |
---|---|---|---|
#7 | 795394-7.patch | 1.97 KB | pwolanin |
Comments
Comment #1
attheshow CreditAttribution: attheshow commentedThe node is getting passed to the form correctly, but when the form is rendered using
return drupal_get_form($node->type .'_node_form', $node);
(This is at the very end of the clone_node_prepopulate function), the options are being ignored and the default settings for the content type are being taken into account.
Comment #2
attheshow CreditAttribution: attheshow commentedI've tracked it to the "node_object_prepare" function that is run on the form by core. It resets things to their default values for the content type. Trying to figure out the best plan of attack...
Comment #3
pwolanin CreditAttribution: pwolanin commenteddid you set the "Should the publishing options ( e.g. published, promoted, etc) be reset to the defaults?" setting?
Comment #4
superxain CreditAttribution: superxain commentedI am using 6.x-1.3 and the problem still is there. When I clone a node with "Promoted to front page" option unchecked, the clone page has the option checked. No matter the "Should the publishing options..." being checked or not.
Comment #5
gpk CreditAttribution: gpk commentedJust hit this problem, also using 6.x-1.3.
The "Should the publishing options ( e.g. published, promoted, etc) be reset to the defaults?" checkboxes are all unchecked.
Comment #6
pwolanin CreditAttribution: pwolanin commentedOk, I can reproduce this - the problem seems to occur in the call to
node_object_prepare($node)
infunction node_form()
In Drupal 7 core handles this better, so it doesn't stomp on the original values
Comment #7
pwolanin CreditAttribution: pwolanin commentedHere's a patch - not totally beautiful, but I don't see a better way
Comment #8
pwolanin CreditAttribution: pwolanin commentedcommitted