Last modified: 2014-09-18 13:15:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53660, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51660 - Detect the edit state to adapt help messages to user errors
Detect the edit state to adapt help messages to user errors
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Wikidata bugs
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-19 07:18 UTC by Rical
Modified: 2014-09-18 13:15 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Rical 2013-07-19 07:18:15 UTC
In this module :
https://test2.wikipedia.org/wiki/Module:Auteur
I display some errors (red colored) to guide the user to use the template. I can display them in some namespaces and not in others. But this is not OK because some errors must disappear when the user validate the page, then they must not disturb the simple reader.
Then I ask for a way to detect EDIT state from Lua level.
Comment 1 Andre Klapper 2013-07-19 10:49:59 UTC
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 https://www.mediawiki.org/wiki/How_to_report_a_bug and add a more useful description to this report, by providing good steps to reproduce, a minimal testcase, actual outcome, and expected outcome. Thanks!
Comment 2 Rical 2013-07-19 17:29:36 UTC
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 https://test2.wikipedia.org/wiki/Module:Auteur
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.
Comment 3 Rical 2013-07-22 14:31:12 UTC
I am sory, I changed the state to normal, but now I correct by revert it to enhancement.
Comment 4 Rical 2014-03-01 11:09:12 UTC
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.
Comment 5 Brad Jorsch 2014-03-03 16:26:02 UTC
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.
Comment 6 Jackmcbarn 2014-04-04 20:57:22 UTC
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.
Comment 7 Rical 2014-08-01 14:35:11 UTC
(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.
Comment 8 Jackmcbarn 2014-08-01 22:09:51 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links