Closed (fixed)
Project:
Flag
Version:
6.x-1.1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 May 2009 at 22:02 UTC
Updated:
11 Apr 2012 at 12:34 UTC
I've added 3 Flag Actions through Administration, Site Building, Flags, Actions. The Action to "Send an email" works fine. However, the other two, "Redirect to URL" and "Display a Message", do not work at all.
I saw a post about AJAX interferring with this functionality and wanted to confirm that this is in fact the cause of my problem. If so, how do I turn off AJAX? Is this something that can be accomplished through Admin menu?
I'm new to Drupal and programming knowledge limited to HTML.
Comments
Comment #1
quicksketchYes it's caused by the AJAX behavior. You can't redirect a user to a URL or show a message on an AJAX request, because the AJAX request ends up showing the message or getting redirected. To turn off AJAX for a flag, visit admin/build/flags, edit the flag you want to turn off AJAX, then change the link type from "JavaScript toggle" to "Normal".
Comment #2
ekh commentedThanks for your quick response! I followed your instructions, and noted that the link type was already set to "normal". I reset it and tested the link again but redirect and display messages are still not working. Can I assume then that it's is not an AJAX behavior issue? Any suggestions on what else I should be looking at?
Comment #3
quicksketchWhen you click the link to flag something, does it reload the page or does it update via AJAX yet? If this flag is being displayed within a view, you may need to edit the view, and change the link display type on the field within the view.
Comment #4
quicksketchClosing after lack of activity.
Comment #5
tpainton commentedI just figured this one out..
The problem is that flag links include a destination parameter. You have to select the "Force redirecting to the given path, even if a destination parameter is given" option in the Triggered rules redirect options on any redirects related to flags. And yes, no javascript or ajax.. with the flag. Much anger and frustration was created with the above issues..
Comment #6
ekh commentedThanks for replying. Sorry about the anger and frustration. I'm not able to locate "Force redirecting to the given path, even if a destination parameter is given" option. I've been away from this for a while, but can't find this setting anywhere. Can you tell me the path?
Comment #7
tpainton commentedHi, sorry for the delay. It sounds like you are using flag actions. I am refering to Triggered Actions in the Rules Module that are kicked off by setting a flag. Sorry, this is my fault for not making it clearer. That said, if you can't make it work with a simple flag action, then it will work using Rules module and a triggered rule with trigger being "A node has been flagged". Frankly, I never use the Actions module anymore as the Rules Module is just more robust and has many more options. Give it a try.
In your triggered rules you will find this option in your action "redirect" that you added under the "DO" section of your triggered Rule. It is located right under the redirect "TO" field.
Since it's inside a triggered rule, I can't post a URL that would make sense to you.
"admin/rules/rules/rules_65/edit/4&destination=admin%2Frules%2Frules%2Frules_65%2Fedit"
Comment #8
ekh commentedHooray! That worked. I installed Rules Module. Thanks much!!
Comment #9
tpainton commentedNo problem! Glad to help.
Comment #10
hubobbb commentedIt works for me too . Very nice . Thank you tpainton .
my site use
Drupal 7.12 .
Flag 7.x