Hello,
I want to redirekt the to userpage after delete a gallery. I test a lot but this did not work for me. Can someone have a look on my rule?
Or is it not possible to do that?
Many thanks for any help!
Frank
{ "rules_delete_a_node_image_gallery_referenced_image_nodes_cloned_" : {
"LABEL" : "Delete a node user image gallery referenced image nodes",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_delete" : [] },
"IF" : [
{ "node_is_of_type" : {
"node" : [ "node" ],
"type" : { "value" : { "node_user_image_gallery" : "node_user_image_gallery" } }
}
}
],
"DO" : [
{ "entity_query" : {
"USING" : {
"type" : "node_gallery_relationship",
"property" : "ngid",
"value" : [ "node" ],
"limit" : "100"
},
"PROVIDE" : { "entity_fetched" : { "entity_fetched" : "Fetched entity" } }
}
},
{ "LOOP" : {
"USING" : { "list" : [ "entity-fetched" ] },
"ITEM" : { "list_item" : "Current list item" },
"DO" : [ { "entity_delete" : { "data" : [ "list-item:nid" ] } } ]
}
},
{ "redirect" : { "url" : "[site:url]user\/[node:author:uid]" } },
{ "drupal_message" : { "message" : "Images [entity-fetched:0] which have been a reference to the deleted gallery were also deleted." } }
]
}
}
Comments
Comment #1
fraweg CreditAttribution: fraweg commentedHello,
can someone give me a tip this is possible and when how to do it ? Many thanks for any help!
Best regards
Frank
Comment #2
fraweg CreditAttribution: fraweg commented... No idea in that issue? :-(
best regards
Comment #3
fraweg CreditAttribution: fraweg commentedWas this a stupid question ? Did someone use the redirect funktion with rules?
Best regards
frank
Comment #4
Samfall CreditAttribution: Samfall commentedI made a custom module to do something similar. It redirects the user back to the gallery when you delete an image. It also will redirect someone who deletes a book node to that book's parent. It uses the following code as the module:
Your question is not stupid. I assume it's easier to change the redirect with a module than with rules. But I've never tried it with rules.