Some actions/ conditions are appearing only after a certain action was added (i.e. #new arguments).
Maybe we should have a page showing all the actions/ condition related to a module, and what arguments need to be present.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 260617_18_rules_hidden_arguments.patch | 6.85 KB | amitaibu |
| #15 | 260617_rules_hidden_arguments_2.patch | 6.6 KB | amitaibu |
| #15 | Screenshot.png | 16.45 KB | amitaibu |
| #15 | Screenshot-1.png | 38.53 KB | amitaibu |
| #7 | rules_radios.diff | 8.47 KB | mooffie |
Comments
Comment #1
fagoyep, that makes sense. How would you integrate this in the UI?
Comment #2
amitaibuMove to Rules
Comment #3
mooffie commentedOne possibility is to show the unavailable actions/conditions in the dropdowns, but to use the 'disabled' HTML attribute for them. The browser will gray them out.
There won't be enough room to explain why they're grayed out. So perhaps we could replae the HTML's by some jQuery gadget that provides some more room.
Comment #4
mooffie commented+1
Admins should be aware of all the wealth potentially available for them.
Comment #5
fagoHm, if we do so, the action select is getting more complicated and bigger for nothing. So I don't think that's a good idea to solve this - but thanks for the suggestion. Integrating it, in the "add action" page sounds to make sense though. Perhaps we should add a new page, which lists all actions + their needed arguments + their exposed new variables + their description and link it their, with a text like "Which actions are available?".
Analogous for conditions.
Anyway, I think I've to postpone this, as there are some other more important things (for rules) I've to work on before. So patches are welcome to speed this up...
Comment #6
mooffie commentedI was off-line so I didn't know, while working on a possible solution, that you consider this to be of low priority.
FWIW, here's a patch that turns the dropdown into radio buttons. So there's now room to show info about hidden actions/conditions. It's possible to turn this feature off via a checkbox in the settings page.
I'm attaching two screenshots.
Comment #7
mooffie commented...and the patch.
(Remember to clear Drpual's cache, for the theme registry to note the new code.)
Comment #8
amitaibuPatch missing.
From what I see in the screen shots, I like the idea.
Comment #9
amitaibuCross post - patch is here :)
Comment #10
mooffie commented(I didn't get a chance to make a screenshot of one of these "2 items are hidden" fieldsets open, but they list the unavailbale actions/conditions together with their "unsatisfied" argument(s).)
Comment #11
fagowow, cool.
I like how the additional information is displayed in a collapsed fieldset. However in your solution this great new feature is only available for the radio mode, which might be a bit confusing. I think it would be better to display the information "X items are hidden" just once -> So we could display it also just below the select box.
* In the help text inside of this fieldset, you talk about actions only. Perhaps just improve it to "actions or conditions".
-> As an affect the radios wouldn't be required any more, but indeed they might give a better overview? So I'd be ok with that change and the new setting.
* Perhaps then rename '#rules_all_infos' to '#rules_all_element_info' or better pass the grouped elements as '#rules_grouped_options' (as the unsatisfied arguments would be in a separate theme function then)
* Watch out for checking action/condition names before printing them -> Use check_plain().
Comment #12
fagoah and perhaps we should improve the wording of the help text a bit, let me try:
The following items aren't available in this context because they require arguments that are not available in this rule. If you want to use any of these items, you must first add some action that loads a suiting variable of this kind.
Content has type
Needed variable type: Content (-> display the data type here)
...
Comment #13
amitaibuHad another idea - maybe we can keep the select list as is, just add a fieldset with the hidden actions/ coditions?
Comment #14
amitaibuI'll roll a patch soon.
Comment #15
amitaibuattached patch inspired by mooffie's work (and screenshots).
Comment #16
fagoI like how you solved it, that's great. Also code quality is good, I've just some minor issues:
* about the text "missing arguments" -> in the help text then it's called "not available". I think it should be "Unavailable argument" here to. Furthermore we should use format_plural there again.
* rules_admin_filter_info() return unsatisfied arguments that aren't used any more. This code should be removed.
otherwise it's fine :)
Comment #17
fagopuh, sry for letting this lie so long.
Comment #18
amitaibuRerolled patch with format_plural, however, note that 'unsatisfied arguments' is used
$output .= '<dd><em>'. format_plural(count($items[$group]['unsatisfied arguments'])...Comment #19
fagothanks. Sry for overlooking the use of the unsatisfied arguments.
I did some further improvements to the strings, now it's called e.g. "28 actions are not configurable" and removed the wording "items" - as rules usually refers to conditions or actions as elements and there is already something like "hidden" condition, which is something different: It's a property for actions/conditions so they are always hidden.
Then I noted that when hidden conditions or actions are available the counting is wrong and fixed that. (e.g. the rule simpletest module adds hidden ones)
-> patch committed, please test. :)
Comment #20
amitaibuWas it committed?
Comment #21
fagoyep, a bit later: http://drupal.org/cvs?commit=161359
sry, I had some troubles with my CVS client