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)

Comments

Status:Needs review» Needs work

+++ b/modal_forms.info
@@ -2,4 +2,5 @@ name = Modal forms
+files[] = modal_forms.rules.inc

this file does not contains classes

+++ b/modal_forms.rules.inc
@@ -0,0 +1,58 @@
+      $url .= '&';
+      $url .= drupal_http_build_query(drupal_get_destination());

write this with one-line

Status:Active» Needs review
StatusFileSize
new2.78 KB

The updated patch.

Status:Needs work» Reviewed & tested by the community

Works!

Status:Reviewed & tested by the community» Fixed

And now committed to 7-dev. Thanks for the nice contribution and the testing!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

How 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

Hmm, maybe you're right. Some including of modules/system.eval.inc may be required.

Status:Closed (fixed)» Postponed (maintainer needs more info)

@15handsmedia Please explain the steps to reproduce this error

@andypost I have get the same error cfr. 15handsmedia
Steps: I just added page redirect to modal_forms/nojs/login

Status:Postponed (maintainer needs more info)» Needs review
StatusFileSize
new433 bytes

This patch fixes the problem by loading the file which defines the missing function.

Status:Needs review» Reviewed & tested by the community

Makes sense

Please commit #10, since the problem #6 is still unresolved.

Status:Reviewed & tested by the community» Fixed

Committed to 7-dev, thanks for the reminder, and the patch of course.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Category:feature» bug
Status:Closed (fixed)» Active

This no longer seems to work. Is anyone else having this problem?

Using the following rule:

{ "rules_login_redirect_athlete_coach" : {
    "LABEL" : "Login Redirect",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "modal_forms" ],
    "ON" : { "user_login" : [] },
    "IF" : [
      { "user_has_role" : {
          "account" : [ "account" ],
          "roles" : { "value" : { "23" : "23", "6" : "6" } },
          "operation" : "OR"
        }
      }
    ],
    "DO" : [
      { "modal_forms_aware_redirect" : { "url" : "dashboard" } }
    ]
  }
}

Category:bug» feature

Thanks @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.

Closing 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.

Status:Active» Closed (fixed)

actually closing this time :)