Steps to reproduce:
1) Add a new triggered rule, event "After saving new content"
2) Add an action "Publish content"
3) Clone this rule and change the event to "After updating existing content"
4) Edit the cloned rule, edit the action and save it without changes
5) The label has now the strange name "Publish created updated content"
6) Edit and save the action again, the label is now "Publish created updated updated content"
...
But the label should just be "Publish updated content"
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | rules-552218.patch | 805 bytes | klausi |
| #2 | rules-552218.patch | 1.08 KB | klausi |
Comments
Comment #1
klausiOK, this actually isn't related to cloning, but to rules_core_node_label_callback()
Shorter to reproduce:
1) Add a new triggered rule, event "After saving new content"
2) Add an action "Publish content"
4) Edit the action and save it without changes
5) The label has now the strange name "Publish created created content"
6) Edit and save the action again, the label is now "Publish created created created content"
Comment #2
klausiHere is a patch that partially fixes the issue: if the label already contains the name of the content variable (e.g. "created content"), then no str_replace() is done to the label.
This does not work if the content variable is changed (e.g. from "updated content" to "unchanged content"), where the bug is still present.
Maybe we should think about just removing the label callback from rules and leaving "content" unchanged.
Comment #3
klausiUrgs, this is just a simple call by reference bug: a '&' was missing, so any savings to $element['#info']['label_skeleton'] had no effect. Thx to fago for pointing out that possibility.
New patch attached, adds only one character :-)
Comment #4
fagough, thanks for tracking this down. I added a comment why we need the reference there and committed it.