Closed (cannot reproduce)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.2
Component:
Modal
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2012 at 21:26 UTC
Updated:
25 Oct 2020 at 01:18 UTC
Jump to comment: Most recent
Comments
Comment #1
czigor commentedIs modal supposed to work together with batch at all?
Comment #2
merlinofchaos commentedHonestly it's not something I have ever tried. Since the modal submits via AJAX but the batch is expecting a normal submission and then redirects to the batch page to handle the patch, I can see where this might not work and would take some extra handling to work properly.
Comment #3
rj commentedFor anyone researching this, one option is to redirect the batch after it's finished through your callback in $batch['finished'] as the very last step.
Comment #4
trim108 commentedIt's because batch_process() function uses drupal_goto by default. You may do the following:
1. form submit:
2. mymodule_batch_url():
Comment #5
bradydowling commentedI tried using the implementation you suggested trim108, but it didn't actually perform the batch operation for me. It just closed the modal. Right now I can only get one thing to happen, either the window closes or the function works. I can't get both to happen. In the past, I altered my submit function so I didn't actually need to perform a batch operation but now I don't have a choice.
Comment #6
albertski commented@trim108 Do you by any chance have a full example or know for sure that this is possible.
Comment #7
darrenwh commentedCan full replication steps be added please?
Comment #8
pankaj.g commentedWhen I try with Ctool modal, it throws error as below.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_my_module_batch_operation' not found or invalid function name in _batch_process() (line 284 of /var/www/html/icss/includes/batch.inc).
Even function _my_module_batch_operation is exists in same module file.
Comment #9
selfsimilar commentedIf this is still an issue for anyone, I'm pretty sure I've got a good work-around based on #4 by trim108.
Comment #10
ldopchev commentedIf anyone is still looking for the answer, @trim108 #4 works like a charm.
Comment #11
stox commentedHey guys
I can't get this to work either, anyone have a working example they could share?
Comment #12
mustanggb commented