Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch adds Rules integration. New Rules action is added - "Page redirect (modal forms aware)" which performs page redirect using one of two methods (considering current path):
1. drupal_goto (standard method which Rules module uses)
2. $_GET['destination'] assignment (which must be used inside AJAX handler issued by Modal forms)
Comment | File | Size | Author |
---|---|---|---|
modal_forms-rules_support.patch | 3.1 KB | maximpodorov |
Comments
Comment #1
andypostthis file does not contains classes
write this with one-line
Comment #2
maximpodorov CreditAttribution: maximpodorov commentedThe updated patch.
Comment #3
andypostWorks!
Comment #4
frjo CreditAttribution: frjo commentedAnd now committed to 7-dev. Thanks for the nice contribution and the testing!
Comment #6
DevJoshLopez CreditAttribution: DevJoshLopez commentedHow do you use this in rules? I tried but im getting an error that says:
Fatal error: Call to undefined function rules_action_drupal_goto() in /home/content/28/7717728/html/sites/all/modules/modal_forms/modal_forms.rules.inc on line 58
Comment #7
maximpodorov CreditAttribution: maximpodorov commentedHmm, maybe you're right. Some including of modules/system.eval.inc may be required.
Comment #8
andypost@15handsmedia Please explain the steps to reproduce this error
Comment #9
jeroenhoutmeyers CreditAttribution: jeroenhoutmeyers commented@andypost I have get the same error cfr. 15handsmedia
Steps: I just added page redirect to modal_forms/nojs/login
Comment #10
maximpodorov CreditAttribution: maximpodorov commentedThis patch fixes the problem by loading the file which defines the missing function.
Comment #11
andypostMakes sense
Comment #12
maximpodorov CreditAttribution: maximpodorov commentedPlease commit #10, since the problem #6 is still unresolved.
Comment #13
frjo CreditAttribution: frjo commentedCommitted to 7-dev, thanks for the reminder, and the patch of course.
Comment #15
areikiera CreditAttribution: areikiera commentedThis no longer seems to work. Is anyone else having this problem?
Using the following rule:
Comment #16
maximpodorov CreditAttribution: maximpodorov commentedIt's #2084885: Incomplete commit?.
Comment #17
areikiera CreditAttribution: areikiera commentedThanks @maximpodorov! I was using the latest dev version, so I've reverted back to 7.x-1.2 + patches from comment #2 and #10, and that works.
Comment #18
areikiera CreditAttribution: areikiera commentedClosing again since original feature was addressed/working.
For those just now implementing this feature, I recommend that you don't install the dev version until https://drupal.org/node/2084885 has been resolved. As mentioned before, 7.x-1.2 + patches from comments #2 and $10 will work.
Comment #19
areikiera CreditAttribution: areikiera commentedactually closing this time :)
Comment #20
Marko B CreditAttribution: Marko B commentedI wouldn't close still. Seems that with lates dev that commit has been reverted and this patches are added, but I still don't get an opened modal form after the creation of the node. I only get normal redirect and all the code seems fine?! I also use modal forms on other parts of site and they work there.
Comment #21
Marko B CreditAttribution: Marko B commentedI am probably getting this wrong. I was expecting that I can redirect to another modal form, but probably this will only work on redirects from modal page to other normal page.
Comment #22
truyenle CreditAttribution: truyenle commentedAs #18 mentioned two options. They are both doesn't work for me. After login user is always redirect to front instead of a page that I setup in rule.
But this is working fine if I just go to /user and login not using modal forms.
Comment #23
robriley78 CreditAttribution: robriley78 commentedI can't get this to work. I have the simplest scenario - a modal login window and a rule which says to redirect to the user's profile on login. I've just created the rule using Rules UI - nothing custom. I've applied the 2x patches from #2 and #10 but still doesn't work. Did I miss something?
Comment #24
robriley78 CreditAttribution: robriley78 commentedOk my bad - for anyone else with the issue, your rule needs to use the Page redirect (modal forms aware) action. The standard Page redirect won't work.
Comment #25
truyenle CreditAttribution: truyenle commentedThank robriley78. It works for me with the dev version of the module that already included patch from #2 and #10.
Comment #26
prsnjtbarman CreditAttribution: prsnjtbarman commentedIt works for me