Page MenuHomePhabricator

Detect the edit state for modules which help users and helpers
Open, LowPublic


Central modules can help users and helpers in some ways:

  • detect errors on arguments names or arguments values
  • report versions management
  • in user and wiki languages
  • display synthesis or tests for helpers, even in small wikis

But all these services must not disturb the simple readers.

Then the modules need the edit state to use specials modes only if edit is active.

See examples and the draft proposition of Central modules.



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:48 AM
bzimport set Reference to bz51660.
bzimport added a subscriber: Unknown Object (MLST).
Rical created this task.Jul 19 2013, 7:18 AM

Hi Rical,
unfortunately this report is not very useful because it does not describe the problem well. If you have time and can still reproduce the problem, please read and add a more useful description to this report, by providing good steps to reproduce, a minimal testcase, actual outcome, and expected outcome. Thanks!

Rical added a comment.Jul 19 2013, 5:29 PM

In complex templates, users can use bad arguments names, or mistake about the value of a century, and so on.
Scribunto permit to detect these errors to assist the user.
This is a new service to users, at Lua level.
The module
can display messages like :
⦁ Error: Wikidata element is not found.
⦁ Error: This argument is required but absent : initiale. Should define it.
⦁ Error: The parameter BirthYear is unknown in this template. The known argument birthyear is it the one you need ?
⦁ Error: The life of the author is too long.
These messages are usefull when a user modify the page, but must disappear for simple readers.
To hide messages, the module must know if the page is in edit state.
I search some hours and ask in some places, but I don't find how to detect the edit state and nobody answers.

Rical added a comment.Jul 22 2013, 2:31 PM

I am sory, I changed the state to normal, but now I correct by revert it to enhancement.

Rical added a comment.Mar 1 2014, 11:09 AM

This bug is not only about data from Wikidata. It's about any edit in any wiki. The result is a value that a scribunto module can read to adapt its work in the edit state of the page. The module must display error messages only in edit mode.

Anomie added a comment.Mar 3 2014, 4:26 PM

If someone cares enough about this to actually implement it, it should be easy enough to do along the lines of Gerrit change 93019, using $this->getParser()->getOptions()->getIsPreview(). And you could as well throw in access to $this->getParser()->getOptions()->getIsSectionPreview() too.

Personally, though, I don't really see the point of modules changing their output based on whether it's a preview or not.

I think it would be a bad idea to allow the previewed version of a page to look different from what it will save to. It could confuse users who see a bunch of changes when they just make one little one, not to mention the field day vandals could have with it.

Rical added a comment.Aug 1 2014, 2:35 PM

(In reply to Jackmcbarn from comment #6)

I think it would be a bad idea to allow the previewed version of a page to
look different from what it will save to.

1 - Each time a user edit any page in any wiki, he sees some alert panels. The module:Auteur do the same one alert panel, just before the normal output.

2 - The goal of the info "edit-state" is exactly to permit to automatic mask this panel to not disturb simple readers, without the risk to keep the panel.

3 - Without the info "edit-state" and the automatic masking, the editing user can forget to mask the panel, which is not so easy. Then the module must catégorize the page to help admins to correct the page and mask the panel.

Okay, a few new things to consider:

  • It's already possible to see if a page is being previewed by looking at {{REVISIONID}}. (I'm not sure this is a good thing, but it's true).
  • Some issues are severe enough that they should be displayed even if the page is saved, like a missing required template parameter.
  • In your use case, you say that the purpose is to keep readers from being confused if the page is saved with errors still in it. However, this would lead to the next editor being confused, since they'd have no idea why errors suddenly appeared when they made some unrelated change.
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Rical added a subscriber: Rical.Dec 12 2014, 8:33 PM

I think this is not Wikidata-specific. @Lydia_Pintscher?

hoo added a comment.Mar 10 2015, 3:42 PM

I think this is not Wikidata-specific. @Lydia_Pintscher?

It's not Wikidata specific (at all), but I guess it concerns us as our Lua functions also throw errors...

hoo moved this task from incoming to monitoring on the Wikidata board.Mar 10 2015, 3:43 PM
Rical renamed this task from Detect the edit state to adapt help messages to user errors to Detect the edit state for modules which help users and helpers.May 23 2016, 4:51 PM
Rical updated the task description. (Show Details)
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMay 23 2016, 4:51 PM
Rical added a subscriber: aaron.Aug 22 2016, 8:42 AM

I seen your work in gerrit. return '' seems a good way. Big thanks @aaron.