I fixed the deletion error and added the patch for showing the progress bar on new creation and now the submit button is redirecting to 'are you sure you want to delete this?'. Please help. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 0001-fix-1189634-by-removing-multistep-submit-buttons-whe.patch | 869 bytes | geek-merlin |
Comments
Comment #1
brandy.brown commentedOK now magically I am not having this problem anymore. figures.
Comment #2
geek-merlinok so close.
Comment #3
perarnet commentedI am having the same issue under a different use case.
When editing a node showing all steps (node/9/edit?step=all) this error occurs if I add a imagefield image in one of the steps. Pressing next redirects to delete, but if I don't add a image, it doesn't.
This does not occur if I follow the normal steps.
Comment #4
geek-merlinhello perarnet,
on your offending form ( node/9/edit?step=all ),
what buttons do you have, and in which order...?
Comment #5
perarnet commentedPrevious and Next. Here's the html output:
<input type="submit" id="edit-previous" name="op" value="< Last" class="form-submit" /><input type="submit" id="edit-next" name="op" value="Next >" class="form-submit" />Comment #6
geek-merlinhmmm, which is of course a strange thing for a "step=all" form.
maybe we should change the logic to just leave the node "submit" button in that case as "prev" and "next" does not make too much sense.
can you try this patch?
Comment #7
perarnet commentedThanks for the patch, it removed the previous and next button, and replaced with a submit button. I miss a delete button.
When I upload a image now, I am redirected to the first step of the multistep edit upon submit of the node, the correct redirect would be to display the node.
Comment #8
geek-merlinso this needs work... as i don't know when i get to it someone(tm) may feel free to volunteer...
Comment #9
perarnet commentedI erred in my last post. It was due to permission settings the delete button was removed. So the remaining problem is the redirect, not the buttons.
Comment #10
perarnet commentedDebugging the conditions of the error reveals that the problem occurs in the function
function multistep_get_step($type) {
....
}
When you upload (or remove) an image, the function gets called, and the step defined for the field is returned. It should naturally return 'all'. Not sure how to fix this.
Comment #11
geek-merlin@perarnet: thank you for sharing your findings.
can you figure out what happens in that function, i.e. which code path is taken and what is returned from which line?
here the code for reference:
http://drupalcode.org/project/multistep.git/blob/refs/heads/7.x-1.x:/mul...
and can you please re-state the problem step by step? i do not get if redirect happens
* immediately at upload
* or at submit after upload
Comment #12
perarnet commentedWhat happens when you upload an image there is a ajax call to the function multistep_get_step. The if statement at line 557 evaluates to true and the default step value for the image field (which in my case is step2) is returned. This affects the submit redirect for the node it seems.
The redirect happens upon node submit in other words.
Comment #13
geek-merlinOK... so we should understand the D7 ajax mechanism thoroughly for this case:
http://drupal.org/node/752056
as i understand it the ajax call should only update the image field.
but it seems to mess with the submit handling in some obscure way...
Comment #14
perarnet commentedI just noticed when doing some debugging that the same issue is alive in the step process.
To recreate:
Create a node type 'multistep'
Add three steps, add image to second step. Upon upload the ajax function redirects "next" submit to node show, not step 3.
Changing title to reflect issue, as the bug issue has changed.
Comment #15
perarnet commentedOk, I'm not sure if this solves all my headaches, but remove the following lines from the function multistep_field_attach_form(), and my initial tests work. I think this might be due to a string of fixes in core since the lines were introduced.
Comment #16
geek-merlinthe lines you shown are legacy so i cant tell but you sure may be right.
have no time to do testing but set to needs review.