After showing the preview of a node, the edit-path input field is empty if you have defined an individual path for that node, after saving the idividual path is overwritten bei the automatic entered path.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 262464_pathauto_node_preview_11.patch | 1.94 KB | greggles |
| #9 | pathauto_node_preview-262464-8.patch | 1.87 KB | Freso |
| #4 | pathauto_node_preview-262464-4.patch | 1.82 KB | dropcube |
| #1 | 262464_1_pathauto_path_textbox_checkbox_should_persist.patch | 1.33 KB | greggles |
Comments
Comment #1
gregglesThanks for the report - I can confirm this issue and also found that the state of the "perform pathauto alias" checkbox is not remembered.
I tested the edit-path problem after disabling javascript and found that the form value is persisted. So, one option would be to use some jquery to un-disable the edit-path or we are either going to have to add some logic that sets it to the proper value on a preview.
For the checkbox, I think that instead of #default_value => TRUE we should consider using the $form['#node']->pathauto_perform_alias) value if it isset.
This attached patch covers the second problem.
Comment #2
gregglesAlso, this only affects 6.x - so perhaps there is something wrong with the way that the form_alter was upgraded from 5.x and this could be fixed more simply...
Comment #3
dropcube commentedThe problem is that in 5.x, the node is submitted for preview using a button, form element, and not a submit form element. The button> element has
#executes_submit_callbackset toFALSE(see system_elements, which means that the form is not really 'submitted', it is re-built with the submitted values. The path is not submitted beacuse the field is disabled, but the node path is used as the default value.However, in 6.x, the preview button has its own submit handler. When summited, the form is proccessed and the node values are overwritten with the form values. For this reason, the path value is lost when the field is disabled.
Comment #4
dropcube commentedHere is a patch that fixes this. The path is saved in a form value and restored back to the text box after the form submission, following a similar hack to the one used in the
pathauto_nodeapipresave.Comment #5
Anonymous (not verified) commentedFor me it still doesn't work...
node -> edit -> uncheck "automatic alias" -> enter new alias -> save -> edit node -> save -> new alias is replaced by autoamtic alias
While editing the second time "automatic alias" is checked again..
Comment #6
dropcube commentedThis issue is related to persist the values of the checkbox and the path when submitting a node for preview, like it works in 5.x versions. Did you test the node preview as you reported initially ?
Comment #7
Anonymous (not verified) commentedOk ;) That works now. Thanks for that!
Should I now create a new issues concerning the checkbox?
Comment #8
greggles@aarakast - no need to create a new issue, see #180440: If an alias is manually created, don't automatically replace it on edit.
Comment #9
Freso commentedRe-rolled. Will test now.
Comment #10
Freso commentedI don't see anything wrong with the code, and it works as advertised.
Comment #11
gregglesrerolled one last time...and committed.
Thanks Dropcube and Freso!
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
JacobSingh commentedI'm seeing this in 7.x-beta1.
s.t.r are the same,
node/add/article
preview
submit
Although now the "auto alias" box is checked, but no alias is created after a preview
Comment #14
JacobSingh commentedthat is after a preview and then a save
Comment #15
dave reidPlease re-check using the latest 7.x-1.x-dev as this should have been fixed with #955926: Path not linked to node id after previewing then saving node
Comment #16
dave reidAnd I'm very sure that it's fixed with that, so I'm going to mark this back as closed. Please re-open 955926 if it is not in fact fixed.
Comment #17
JacobSingh commentedAw good. I searched for preview a couple times and didn't see that one come up. My bad. Thanks for the fix.