Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RT_Config.pm.in: PriorityAsString clarity for perl noobs #354

Open
wants to merge 1 commit into
base: 5.0-trunk
Choose a base branch
from

Conversation

NReilingh
Copy link
Contributor

For your consideration:

Speaking from the perspective of someone who has not been hacking with perl for decades, I was recently trying to configure this setting in RT5's web interface, and had to do a bit of head-scratching. One change here is reordering HashRef and ArrayRef to match the code example, though perhaps it is preferred to reorder the code example instead of the text - either way, they should be consistent for people who are not familiar with the terminology.

The other change is to express the ArrayRef with commas instead of fat arrows. In RT5's web interface, these kinds of values are provided as JSON which is then deserialized/reserialized into Perl's object syntax, but from looking at the fat arrows in the ArrayRef example, it's not necessarily obvious that the JSON serialization of this is just going to be an array of scalars. I tried both "General": [ {"Medium": 50}, {"Low": 0} ] and "General": [ {"Medium": 50, "Low": 0} ] before I remembered that => is equivalent to , and should try a regular array.

Not the first time I've been confused by this while working with RT5's web configuration... but I'm getting better. Still I think it would be worthwhile to think about helping non-perl-native admins translate the perl syntax to JSON.

The code example's ordering did not match the prose. Also, `=>` being equivalent to `,` is not commonly known to someone who may be trying to configure this setting through the 5.0 web configuration interface which accepts JSON, so using `,` in the `ArrayRef` variant is more helpful.
@cbrandtbuffalo
Copy link
Member

We agree the mix of Perl and JSON configuration can be confusing. We're thinking an even better fix would be to provide an example of both formats, Perl and JSON. It should be possible to automatically generate a JSON version based on existing Perl examples for the configuration options that accept data structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants