I have a webform inside a colorbox node, shows nicely, submits...
But, both the built in redirect in webform and rules redirect is ignored and the modal stays stubbornly open. And no redirect happens.

Furthermore inside my rule i also set a status msg which never shows.

I do know that the rule is triggered because it also creates a new entity on submissions and sets values from webform to a node. And this part of rules actions happens ok... There is no errors in the log either...

Please help... :) Thanks in advance...

CommentFileSizeAuthor
#4 webform_redirect-1653384-4.patch1.66 KBiLLin

Comments

iLLin’s picture

Currently the only thing I got working was the confirmation message. When I get time I will put in the remaining effort to get it to redirect based on the settings. You can also supply a patch and I will look it over.

Anonymous’s picture

Could you point me to that part of code i should look at improving? how is the node in colorbox different that it prevents the rules module from doing a basic drupal goto function?

iLLin’s picture

Sure, everything is going through AJAX, so a simple drupal goto function will not work. Read the lines 184 on in the .module file. Instead of returning the confirmation message, the idea would be to return a colorbox.close method along with a window.location of the confirmation URL. A check would need to be put in to determine what to return based on the webform settings.

iLLin’s picture

Status: Active » Needs work
StatusFileSize
new1.66 KB

Give this patch a try, its a start, not sure on the reload current settings option and what the expected behavior should be. This patch should allow you to pass a redirect and auto close the modal and then do a redirect. It will also reload inside the modal if you want a confirmation message.

iLLin’s picture

Status: Needs work » Needs review
dalerr’s picture

I tried #4, and redirect to custom URL working good. (modal window closes and page reloads)
But how to insert confirmation message after page reloads?

iLLin’s picture

Your custom URL page should have your message? If you just want the confirmation message to be displayed why redirect, you could just display it inside the modal box. I guess I'm trying to understand the use case or the missing expected functionality.

iLLin’s picture

Version: 7.x-2.1 » 7.x-2.2
Status: Needs review » Fixed

Patch added to latest release 7.x2.2. Please update this with more information if something else needs to be addressed.

dalerr’s picture

If you just want the confirmation message to be displayed why redirect

Its design issue (modal window have static background with buttons and input fields on it xD)

Because of that, I want redirect to confirmation page (custome URL) with message, or just message in the top of /contact page after it refreshes.

PS I'll test the new version.

iLLin’s picture

Status: Fixed » Active

Hmm, so the page you are redirecting to doesn't have the thank you, you just want a status message? I thought that happened automatically... I will take a look at this some more when I get a change and any more information about this will definitely, help.

merilainen’s picture

Is it possible to use percentages any more after the type casting which was added in the latest update? I'm writing here, because this issue was mentioned in the notes. Before I was using <a class="colorbox-node" href="/node/[nid]?width=70%&height=80%"> but that doesn't work anymore.

iLLin’s picture

Well I could probably change it instead of type casting, to put it through some regex/validation function. Not sure when I'll have time but I will take patches :)

merilainen’s picture

Any reference I could use to do this? I'm not sure what would be the secure way to do it, but I have time to write a patch.

iLLin’s picture

I would search to see if the % exists and then strip it out. Force the rest of the string to be an integer and then put it back together as a percent manually when adding to the colorbox settings. That should be secure enough as you are forcing an integer and manually adding a percent if it existed in the first place.

iLLin’s picture

Please see: #1722430 for % in the URL for width and height.

iLLin’s picture

Status: Active » Closed (fixed)

Redirect works. Any messages please add them to the redirect page. Unless you can give me a use case where thats not possible, Im closing this as fixed.

asolorzano’s picture

Hi iLLin, sorry about my english lol I´m editting a node in a modal window using colorbox but when I submit the form it closes the window and then redirects to node/nid but I need two of this options and I don´t know how to do it!!.. one is to redirect to a custom page after closing the window and the other one is to display a message on the same window after editting the node and manually the user closes the window. Thanks for any help... I´m using this but no luck!! :(

function spqr_form_spqr_node_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'spqr-node-form') {
$form['actions']['submit']['#submit'][] = 'spqr_node_submit';
}
}

function spqr_node_submit($form, &$form_state) {
$form_state['redirect'] = 'administrar/solicitudes';
}

pignaz’s picture

I find this simple solution. I you want to redirect webform you write destination parameter into colorx call. For example If you have link to colorbox you write into href:

open colorbox window

pignaz’s picture

ops......

<a href="/call-to-page-into-colorbox?width=1020&height=700&destination=[url to destination]" rel="nofollow">open colorbox window</a>

rewerz’s picture

Issue summary: View changes

#19 is perfect