If using a link to create a node with some arguments (e.g. pre-setting a group audience for an OG post, or the destination URL), the way the module currently works will lose these (or, will just use the "destination" path instead of the redirect URL).
The documentation of $form_state['redirect'] indicates that "FALSE" will just cause the current form to reload, which is what we want (the destination will always be the current form, if we are to "add another"). It is a simple fix that will preserve the arguments (including, the ultimate destination once the user clicks "save" instead of "save and add another").
line 32:
$form_state['redirect'] = false;
Hope this helps!
Delphine
Comments
Comment #1
pimousse98 commentedI spoke too soon.
What we want is the "default" drupal behavior instead of "false" - "false" causes the fields to stay filled, instead of the page reloading with cleared fields (http://drupal.org/node/144132). Is there a way to make sure that the fields are cleared when the new form is loaded?
Comment #2
moshe weitzman commentedI committed the FALSE solution since sometimes its what you want (preserve fom field values). Also, I needed to get this button to stop honoring destination= on the url.
Comment #3
rolfmeijer commentedI’m not sure if this is in practice a proper solution.
I have to add more than a thousand articles, so every click I can save is useful. The problem now is that the fields are prefilled, which would not be such a big problem if Autofocus remained working. But since 1.3 it doesn’t, which I guess is related to this solution (though not being aprogrammer at all, I have to be modest :-) ).
Anyway, the combination of these two issues (prefilled fields and no autofocus) is the real problem here. I have to click the first field AND I have to select the content of the field. To me that is a real drawback, so I hope you can look at another solution.
Of course, if this issue has nothing to do at all with the problems just described, I can make this into a seperate one.
Comment #4
rolfmeijer commentedSorry, forgot to change the status. Obviously, change it back if you don’t agree.
Comment #5
moshe weitzman commentedI think you should open a feature request to stop prefilling.
Comment #6
rolfmeijer commentedThank you. See #810862: Request to stop prefilling.
Comment #8
mark. commentedThis worked for me: