Closed (outdated)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Modal
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2012 at 22:37 UTC
Updated:
20 Jul 2026 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
daffie commentedComment #2
daffie commentedComment #3
merlinofchaos commentedCan you please post a wizard config that duplicates this? I have a LOT of wizard forms and none of them exhibit the behavior you speak of; it is the kind of thing I keep an eye out for.
The way the code is written, if $form_state['previous'] is set, then there absolutely should be a back button. The code that loops through $form_state['order'] does not have an obvious way to even get $form_state['previous'] to == $form_state['step']. So there's something else wrong here, I think.
Comment #4
daffie commentedWhat I what to do is that the first step in my wizard is selecting an action and depending on the selected action there are one or more steps.
The combination of the wizard, (popup)modal and a changeing number of steps is not working. If you have ideas how I can fix this. Please let me know.
Comment #5
merlinofchaos commentedI believe the way to fix that in your could would be that if you are changing the steps, you should actually change $form_info['order'] so that the wizard knows what things will actually be based upon current data.
Comment #6
merlinofchaos commentedNote that I'd need to see what you're actually doing to provide better advice. But for now I have a feeling the problem you're seeing has more to do with your code manipulating incorrectly than wizard itself having a bug. I'll revise this opinion once I get more data.
Comment #7
daffie commentedAfter selecting the action the $form_info['order'] is changed. With the regular wizard page all is good. With the wizard in the (ajax)modal the new $form_info['order'] is lost or is using a cached old version.
I can make a simple example that has the problem in it.
Comment #8
merlinofchaos commentedAha! Now that's getting us to the meat of the problem!
Let's see your example, please!
Comment #9
daffie commentedI have made a small module for my example. In my example I do two attempts to change the order.
To produce the bug: Open the wizard in the modal. Then in the wizard select action2.
What happens: The trail changes the calling form does not.
My code for modalwizard.module:
My code for modalwizard.info:
Comment #10
MhueD commentedThis is still a problem: -please see http://drupal.org/node/1344708 ... which totally replicates on my core 7.14, CTools 7.x 1.0, build.
Comment #11
leolandotan commentedThe patch in #1 fixed my issue on the Back button being displayed after coming from the next steps. Btw, Wont they apply this patch?
Thanks daffie!
Comment #12
daffie commented@leolando.tan: I am happy that my patch solves your problem. I would love to get this patch committed. The problem is that somebody else needs to review this patch. If that somebody has reviewed this patch and comes to the conclusion that this patch is worth to be upgraded to status of RTBC (Reviewed and Tested By the Community), then the module maintainer can commit this patch. And I am hoping that you will be the one who will do the review. You will be helping the drupal community. The drupal community has lots of people who can help you.
Comment #13
leolandotan commentedReproduced this issue on Drupal 7.34, CTools 7.x-1.5.
1. Enabled Chaos Tools (CTools) AJAX Example Example
2. Opened /ctools_ajax_sample
3. Clicked Wizard (default modal), Wizard (custom modal) and Wizard (button modal) and had no Back button on the first step
4. In these modal multi-step forms, I entered a value then clicked Continue
5. On the second and final step, I clicked Back and then on the first step which supposedly shouldn't have the Back button has it.
6. Clicked Back again and it loops through the steps.
Fix:
1. This patch fixed the issue by adding an additional condition if it's the right step to display the Back button.
2. This also took out a variable that has not been used anywhere in the code.
This also doesn't affect any other modules and Drupal core.
Note: This issue is only present for the modal version. The nojs version doesn't have this issue.
Comment #15
leolandotan commentedOh my! I'm very sorry for that. I thought the re-test was just right away. -__-"
Comment #16
japerryIf possible, I'd like Merlinofchaos to respond to the example.
Comment #17
damienmckennaComment #19
sumthief commentedLooks like there is exists same problem.
I have other vision how to solve this problem (https://www.drupal.org/node/1344708#comment-11523645).
Attached patch here and close that problem as duplicate.
Comment #20
chris matthews commentedThe 2 year old patch in #19 to wizard.inc applied cleanly to the latest ctools 7.x-1.x-dev, but still needs to be reviewed and tested.
Comment #21
japerryDrupal 7 is no longer supported, closing.