This issue attempts to extend the help and on-site documentation for the Rules project in the following ways:
* Adding "configure" links in the modules list for Rules and Rules Scheduler. (done)
* Adding and improving a number of description texts in the Rules UI. (done)
* Providing a way to manage links to drupal.org docs pages in one central place in the code. (partly done)
* Adding a help page for Rules, as used by the Help module, containing all the links used in inline help. (done)
The current stumbling block is where to place the function rules_external_help(), used for collecting urls for external help pages (as well as the list of all such links).
The function is currently placed in ui.forms.inc, which means that it is available at all places where UI is shown. However, this file is not included when running SimpleTests, making the tests for this issue to fail.
A possible solution is to let the SimpleTests include ui.forms.inc – but there are probably better ways of doing this.
Comment | File | Size | Author |
---|---|---|---|
#35 | rules_help.patch | 14.9 KB | fago |
#33 | 1297414-33-lots_of_help_stuff.patch | 15.59 KB | Itangalo |
#30 | 1297414-30-lots_of_help_stuff.patch | 17.05 KB | Itangalo |
#29 | 1297414-29-lots_of_help_stuff.patch | 17.04 KB | Itangalo |
#26 | 1297414-25-lots_of_help_stuff.patch | 17.08 KB | Itangalo |
Comments
Comment #1
Itangalo CreditAttribution: Itangalo commentedI just had the greatest idea – I can implement this as a separate module, and if it works well then it could be merged into the Rules project. Damn, I'm so smart. :-P
Comment #2
fagoI like the idea, though I don't think we should make an on/off option for the help. Ideally, would be always there and just one click away. E.g. it could be hidden by JS by default.
Still, we can surely add more help that is just visible by default. If its not longer than 2,3 sentences it should be fine.
Let's ping klausi about that.
Comment #3
fagoNew proposal:
Itangalo, So let's add more visible help (2-3 sentences) including points to the handbook for the advanced help?
Comment #4
klausiI also think that the extensive help should be in the handbook pages. Adding some explanations here and there sounds good to me, but we should always link to the handbook pages. We could also hide the help in a javascript fieldset or behind a help symbol, if we think it clutters the page.
I don't think we should add links to screencasts in code, instead we could maybe create a Rules screencast learning page in the handbooks. Handbooks are easier to edit for people that are not familiar with the patch workflow.
Comment #5
Itangalo CreditAttribution: Itangalo commentedAllright!
Attached is a (sadly) big patch, that does the following:
1) Adds configuration links to the modules list. This is done only if Rules UI is enabled.
2) Adds heaps of descriptions and help texts. Most of these are 1–2 sentences and then a link to some page on Drupal.org.
3) Adds a help page for Rules. (Again, only available if Rules UI is enabled.) The help page states that documentation is kept online, and then lists all the pages used in the description texts (along with some labels).
TODO:
* For Rules maintainers: See if you think this is a good approach for descriptions/inline help.
* For me: Create/update the relevant documentation pages on Drupal.org, and then update the links in the descriptions.
Comment #6
Itangalo CreditAttribution: Itangalo commentedOk, new patch!
Updates from previous one:
* The helper function for keeping track of external docs pages is now moved to rules_admin.module (instead of rules_admin.inc). This is bad from a performance point of view, but good since it makes it possible to use it at all places where we refer to external docs.
* The helper function now contains all the data for the external pages, which makes it easier to maintain them and also makes it much neater to build the on-site help page.
NOTE 1:
I am not 100% sure that rules_admin is loaded at all places where the Rules user interface may try to call rules_admin_external_help(). With Rules core, the interface is only called from rules_admin (as far as I know), but other modules may implement other user interfaces. With rules_admin turned off, this would give fatal errors.
Any good ideas on how to manage this?
NOTE 2:
The previous patch passed all tests. Yay!
Comment #8
Itangalo CreditAttribution: Itangalo commentedNew patch. Just minor updates to the helper function (such as pushing URLs through url() before returning them).
I think the test fails above are caused by what I describe in note 1 above. One possible solution would be to actually add the helper function into rules.module, but that seems pretty heavy to me.
Comment #10
Itangalo CreditAttribution: Itangalo commentedFor testing purposes, I tried moving the helper function to rules.rules.inc, instead of rules_admin. Let's see what the bot thinks.
Comment #11
Itangalo CreditAttribution: Itangalo commented/me scores. :-)
Comment #12
Itangalo CreditAttribution: Itangalo commentedSigh. Seems some files weren't saved, so here's a new patch. Learning every day.
Comment #13
Itangalo CreditAttribution: Itangalo commentedDammit – now another include is run for the help page.
Comment #14
fagoCoding style says we should not add line breaks here. Just make a loooong line, editors can still break it for users.
Let's call them "token replacements" not just tokens, because token == replacement is drupalism.
Yep, that sucks though is the best way to do it by now.
We should find a way to go with the token.module ui.
It suffices to document this for @return once. $topic should be marked as " (optional) The key ..
We should add a new line before return. I know it's violated in rules too, but let's start doing it right.
Can we do such nice urls? :D
Let's say "token replacement patterns" ?
Why do we specify a label if we don't return it.
Just use isset(), that's preferred to is_null.
rules *react*
typo: muste
that must be met to fire the rule?
or
"that must be met for the actions to be executed"
... and call it from your custom module? Is that of interest?
Why not just use rules_admin_help() ?
IT doesn't really fit in rules.rules.inc. Let's move it into ui/ui.forms.inc ?
That should be included every time the UI is used, we just have to include it here then.
Oh that's nice - great idea!
There shouldl be no \' in t(). Use "" instead of ' and you can just go with "'".
Hm, that's not generally true. E.g. user account fields are always there, as there are no bundles. So maybe say if there are bundle-specific fields.. ?
the each..
Comment #15
Itangalo CreditAttribution: Itangalo commentedGreat feedback! Learning a lot from reading it. Looking forward to updating the code.
Some feedback on the feedback:
> Can we do such nice urls? :D (http://drupal.org/data-selection)
Nope, we can't. :-( I'm gonna update them all to relevant urls before the patch is complete.
> Why do we specify a label if we don't return it. (for the rules_external_help function)
The labels are used on the Rules help page. In a previous patch I had the help function add all the labels, but it seems much better to have them declared at the same place as the urls.
> ... and call it from your custom module? Is that of interest? (concerning components)
Yes! Good point.
> Why not just use rules_admin_help() ?
Because then the help topic will show up as "Rules UI" instead of "Rules", which I thought was bad.
Comment #16
fago>Because then the help topic will show up as "Rules UI" instead of "Rules", which I thought was bad.
I see, then we should comment that. :)
>The labels are used on the Rules help page. In a previous patch I had the help function add all the labels, but it seems much better to have them declared at the same place as the urls.
Oh, I see.
Comment #17
Itangalo CreditAttribution: Itangalo commentedAttached is the patch, with comments above fixed. :-)
Two notes:
* In the really loooong t() texts, I have placed the array with replacement patterns on a line of its own. I'm not 100% that this is according to coding standards, but it will make it easier to read and also won't put line breaks into the actual t() text.
* A few of the t() texts previous wrapped with ' had links in them – where the url was wrapped with ". Since the t() text is now wrapped with ", I have changed the url wrapping to '. (I think this is against the recommended best practices, but it makes the code easier to read and avoids using \".)
I also noticed that the help page got a fatal error, which is now fixed. I think this is the only place where rules_external_help() outside the UI, so it should be allright now.
Also, all links now point to the right pages online. We could (and maybe should) add more pages to list on the help page – even if they are not used in the inline help – but I think that could be done later.
This means, that if the patch feels ok, it should be ready to go in. Yeah!
Comment #19
Itangalo CreditAttribution: Itangalo commentedFound one miss in the rules_external_help function, now corrected. Can't see why it should cause the error above, so we'll see how this works…
Comment #21
Itangalo CreditAttribution: Itangalo commentedOk, I now suspect that the automated tests don't load the UI files, which means that the rules_external_help function isn't declared. I'm wrapping it in a function in rules.module in the attached patch. If this works we need to find a better way of solving this (such as including the UI files in the automated tests).
Comment #22
Itangalo CreditAttribution: Itangalo commentedDammit.
Comment #23
Itangalo CreditAttribution: Itangalo commented…
Comment #24
Itangalo CreditAttribution: Itangalo commentedOk, so the problem is that ui.forms.inc is not included when running SimpleTests. Kind of silly to have an error only triggered by tests, but it also signifies that it might be possible to load Rules stuff without the required file inclusion.
What to do?
* Move the file to another place?
* Have a commonly available wrapper function (which is the case in the patch at #23)?
* Explicitly include ui.forms.inc in the SimpleTests?
* Something else, much smarter?
I don't really know how to solve this in a good way, so any input would be great.
Comment #25
Itangalo CreditAttribution: Itangalo commentedFor information: I've created a module that uses a similar approach to managing external help pages, and I hope to make it a bit more sophisticated. (See http://drupal.org/project/externalhelp.) It doesn't affect Rules in any way, except that I might get some experience and ideas that may be useful here.
Comment #26
Itangalo CreditAttribution: Itangalo commentedAnd there it is – some new ideas collected from the External Help project.
I have now added two links that are *not* explicitly used in the inline help, but listed on the help page. I have also reordered the links, making them appear in a more natural order on the help page.
Problem with inclusion of ui.forms.inc is still present.
Comment #27
fagosets of Rules configuration, as it need not be a rule.
so let's use "sets of Rules configuration" again?
lol
what does mean if a configuration is indented under a plugin?
Also, I think we should hide the "plugin" term from the user here, but use @plugin.
Then, configuration is in Rules usually the whole thing. The parts are called "elements".
I'll try to come up with an alternative. What about that?
"Use indentation to move a @plugin into the @config-plugin."
Still, that's not true for user accounts. Should we ignore that?
What about calling this $topic_url ? The internal key for which to get a URL.
url-checked URL doesn't make much sense to me ;) Also, we don't need to run full url's through url() - it is already ready to use.
Comment #28
fagoI just ran the tests with a failing test and I had no problems - so don't mind the testbot. It fails randomly for rules :( ui.forms.inc should be fine!
@rules_help()
I'm not sure about listing all that links there. It looks a bit random to me. Do you think this gives more value than just linking to the online documentation, where the links are anyway in a structured way? Maybe we should just add a short sentence what rules is about though.
Comment #29
Itangalo CreditAttribution: Itangalo commented-1-
All comments in #27 now taken care of, except '$topic_url'. I see this key as the identifier of a help section, and the help section contains both a url and a label – so I still call it '$topic'.
-2-
Concerning #28 and rules_help:
To me it makes sense to have all links listed on the help page – it is a list of shortcuts to good Rules documentation, and it is also a way to find "that help link that was somewhere in the UI". However, I don't feel strongly for it, and if you think it's better with just a short help text and a general link I'm fine with that too. (That would also make the list of Rules help topics much easier, since each entry becomes a string rather than an array.)
-3-
Concerning workning/non-working tests: I have added a wrapper function for rules_external_help into rules.module, which is why the tests are working now. It is an ugly solution, and I want to find another one.
(I will make another run with the test bot, to verify that this was actually the thing that made the difference – I'm not 100% certain. But first checking *this* patch.)
Comment #30
Itangalo CreditAttribution: Itangalo commentedRemoving the function used for test-bot trickery. Hoping for green results.
Comment #32
fagohm, looks like there is an issue :/ I'll look into it.
>All comments in #27 now taken care of, except '$topic_url'. I see this key as the identifier of a help section, and the help section contains both a url and a label – so I still call it '$topic'.
The thing is that it is very strange that the topic definition has a label and a url, but you only get the url if you pass the topic.
Yep, that would simplify things a bit. I don't think its necessary, but I'll leave it up to you! Or maybe someone else has an opinion.
Comment #33
Itangalo CreditAttribution: Itangalo commentedNew patch!
The function for listing help pages now *only* returns URLs, and the parameter is now called '$id' rather than '$topic'. Help page updated – it now contains a few manually selected links.
The problem with including ui.forms.inc in SimpleTests is still there.
Comment #35
fagoI think $topic is more descriptive than id though. I've shortly worked over the patch:
* Moved rules_help into rules
* moved rules_external_help into rules.module - now it's not long any more!
Please review.
Comment #36
Itangalo CreditAttribution: Itangalo commentedSlick!
Comment #37
fagoCommitted - just in time for 2.0 :)
Comment #38
Itangalo CreditAttribution: Itangalo commentedYEAH!
I look forward to seeing this live.
Comment #39.0
(not verified) CreditAttribution: commentedUpdated issue summary to reflect current state.