Last modified: 2014-03-13 19:05:10 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 T63834, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61834 - leaction api documentation contains some weird bold parts
leaction api documentation contains some weird bold parts
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.23.0
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-23 20:30 UTC by Maarten Dammers
Modified: 2014-03-13 19:05 UTC (History)
9 users (show)

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


Attachments

Description Maarten Dammers 2014-02-23 20:30:38 UTC
On https://en.wikipedia.org/w/api.php , not sure why some parts are made bold:

institution/<b>*, course/*, student/*</b>, student/add, student/remove,
                            online/<b>*, online/add, online/remove, campus/*, campus/add, campus/remove, instructor/*</b>,
                            instructor/add, instructor/remove, eparticle/<b>*, thanks/*</b>, delete/flow-delete-post,

Rest is all plain text (except the start of a section)
Comment 1 Sam Reed (reedy) 2014-02-23 21:08:47 UTC
I suspect its EducationProgram actually

Using some sort of formatted output wrongly
Comment 2 Andrew Green 2014-02-24 00:46:19 UTC
After a quick look, I'd say it's more likely a formatter problem. The text seems to come from the EducationProgram extension's Education.php, lines 294-308, but there are no <b> tags in there. Also, all the bold text appears on lines with two or more asterisks, and includes a string ("thanks") that doesn't appear anywhere in extension code. Thanks for thinking of us, though! :)
Comment 3 Sam Reed (reedy) 2014-02-24 01:33:57 UTC
Oh asterix.

Does nothing else add them with its additions to log events?

* action=foobar *
Comment 4 MZMcBride 2014-02-24 01:41:11 UTC
From <https://en.wikipedia.org/w/api.php>:

> leaction            - Filter log actions to only this type. Overrides letype
> One value: block/block, block/unblock, block/reblock, protect/protect, protect/modify, protect/unprotect,
>     protect/move_prot, upload/upload, upload/overwrite, upload/revert, import/upload, import/interwiki,
>     merge/merge, suppress/block, suppress/reblock, review/approve, review/approve2, review/approve-i,
>     review/approve2-i, review/approve-a, review/approve2-a, review/approve-ia, review/approve2-ia,
>     review/unapprove, review/unapprove2, rights/erevoke, gblblock/gblock, gblblock/gblock2,
>     gblblock/gunblock, gblblock/whitelist, gblblock/dwhitelist, gblblock/modify, globalauth/delete,
>     globalauth/lock, globalauth/unlock, globalauth/hide, globalauth/unhide, globalauth/lockandhid,
>     globalauth/setstatus, suppress/setstatus, gblrights/usergroups, gblrights/groupperms,
>     gblrights/groupprms2, gblrights/groupprms3, suppress/hide-afl, suppress/unhide-afl, move/move,
>     move/move_redir, delete/delete, delete/restore, delete/revision, delete/event, suppress/revision,
>     suppress/event, suppress/delete, patrol/patrol, rights/rights, rights/autopromote, stable/config,
>     stable/modify, stable/reset, spamblacklist/*, renameuser/renameuser, gblrights/grouprename,
>     gblrights/newset, gblrights/setrename, gblrights/setnewtype, gblrights/setchange,
>     gblrights/deleteset, abusefilter/modify, abusefilter/hit, articlefeedbackv5/protect,
>     articlefeedbackv5/create, articlefeedbackv5/helpful, articlefeedbackv5/undo-helpful,
>     articlefeedbackv5/unhelpful, articlefeedbackv5/undo-unhelpful, articlefeedbackv5/flag,
>     articlefeedbackv5/unflag, articlefeedbackv5/autoflag, articlefeedbackv5/clear-flags,
>     articlefeedbackv5/feature, articlefeedbackv5/unfeature, articlefeedbackv5/resolve,
>     articlefeedbackv5/unresolve, articlefeedbackv5/noaction, articlefeedbackv5/unnoaction,
>     articlefeedbackv5/inappropriate, articlefeedbackv5/uninappropriate, articlefeedbackv5/archive,
>     articlefeedbackv5/unarchive, articlefeedbackv5/hide, articlefeedbackv5/unhide,
>     articlefeedbackv5/autohide, suppress/request, suppress/unrequest, suppress/decline,
>     suppress/oversight, suppress/unoversight, massmessage/*, massmessage/send, massmessage/failure,
>     massmessage/skipoptout, massmessage/skipnouser, massmessage/skipbadns, pagetriage-curation/reviewed,
>     pagetriage-curation/unreviewed, pagetriage-curation/tag, pagetriage-curation/delete,
>     pagetriage-deletion/delete, institution/<b>*, course/*, student/*</b>, student/add, student/remove,
>     online/<b>*, online/add, online/remove, campus/*, campus/add, campus/remove, instructor/*</b>,
>     instructor/add, instructor/remove, eparticle/<b>*, thanks/*</b>, delete/flow-delete-post,
>     delete/flow-delete-topic, suppress/flow-suppress-post, suppress/flow-suppress-topic,
>     e/flow-flow-rev-message-edit-title, e/flow-flow-edit-title, n/flow-flow-rev-message-new-post,
>     n/flow-flow-new-post, e/flow-flow-rev-message-edit-post, e/flow-flow-edit-post,
>     r/flow-flow-rev-message-reply, r/flow-flow-reply, r/flow-flow-rev-message-restored-post,
>     r/flow-flow-post-restored, h/flow-flow-rev-message-hid-post, h/flow-flow-post-hidden,
>     d/flow-flow-rev-message-deleted-post, d/flow-flow-post-deleted,
>     s/flow-flow-rev-message-censored-post, s/flow-flow-post-censored,
>     e/flow-flow-rev-message-edit-header, e/flow-flow-edit-summary,
>     c/flow-flow-rev-message-create-header, c/flow-flow-create-summary, c/flow-flow-create-header,
>     s/flow-censor-post, s/flow-censor-topic, delete/flow-restore-post, suppress/flow-restore-post,
>     delete/flow-restore-topic, suppress/flow-restore-topic, newusers/newusers, newusers/create,
>     newusers/create2, newusers/byemail, newusers/autocreate

This seems to be a MediaWiki core API formatter issue. On lines with more than one asterisk, bolding is applied. The "spamblacklist/*" and "massmessage/*" lines are fine. The other are (greedily) highlighted, it seems.
Comment 5 MZMcBride 2014-02-24 01:43:25 UTC
(In reply to MZMcBride from comment #4)

A less stupid look at what I pasted: <http://p.defau.lt/?CY9Ufn_TFEz_2jG32ySa4Q>. Apparently a preceding ">" isn't sufficient. Bah.
Comment 6 MZMcBride 2014-02-24 01:50:07 UTC
---
	if ( $this->mHelp ) {
		// make strings inside * bold
		$text = preg_replace( "#\\*[^<>\n]+\\*#", '<b>\\0</b>', $text );
	}
---

From <https://git.wikimedia.org/blob/mediawiki%2Fcore.git/d8c03733718ac9eedabad7e4fa569426a56acc31/includes%2Fapi%2FApiFormatBase.php#L276>.
Comment 7 Kunal Mehta (Legoktm) 2014-02-24 02:27:29 UTC
I think the real bug here is that things like massmessage/* shouldn't be showing up in the documentation since those are invalid log actions: <https://en.wikipedia.org/w/api.php?action=query&list=logevents&leaction=massmessage/*>
Comment 8 Brad Jorsch 2014-02-24 15:31:03 UTC
(In reply to Kunal Mehta (Legoktm) from comment #7)
> I think the real bug here is that things like massmessage/* shouldn't be
> showing up in the documentation since those are invalid log actions:
> <https://en.wikipedia.org/w/api.
> php?action=query&list=logevents&leaction=massmessage/*>

Is there a canonical way to get the full list of valid actions?
Comment 9 Umherirrender 2014-03-05 20:35:54 UTC
(In reply to Brad Jorsch from comment #8)
> Is there a canonical way to get the full list of valid actions?

There is no way, except of deprecating the wildcard for log action handles, because than all actions will be shown up there.

Remove the wildcard actions with Gerrit change #117041
Comment 10 Umherirrender 2014-03-10 20:05:47 UTC
(In reply to Umherirrender from comment #9)

> Remove the wildcard actions with Gerrit change #117041

Patch Set was changed to let the wilcard actions work. But the format problem still exists.
Comment 11 Umherirrender 2014-03-10 20:16:02 UTC
The simplest fix is to use line anchors and only allow bolding of rows with * at begin and end. But I do not know, if that will break intented highlighting.
Comment 12 Brad Jorsch 2014-03-11 14:38:50 UTC
(In reply to Umherirrender from comment #11)
> The simplest fix is to use line anchors and only allow bolding of rows with
> * at begin and end. But I do not know, if that will break intented
> highlighting.

Looking at a few examples, it seems that the only bit of API help text in core and WMF-deployed extensions that wouldn't be caught by a regex along the lines of /^(\s*)(\*.*\*)(\s*)$/m => "$1<b>$2</b>$3" is an instance of "*always*" in ApiQueryRandom. So I'd merge a patch that changed the regex like that.
Comment 13 Gerrit Notification Bot 2014-03-11 19:34:35 UTC
Change 118130 had a related patch set uploaded by Umherirrender:
Adjust magic bolding in api help to only match lines inside *

https://gerrit.wikimedia.org/r/118130
Comment 14 Gerrit Notification Bot 2014-03-13 19:00:56 UTC
Change 118130 merged by jenkins-bot:
Adjust magic bolding in api help to only match lines inside *

https://gerrit.wikimedia.org/r/118130
Comment 15 Brad Jorsch 2014-03-13 19:05:10 UTC
The fix for the bolding should be deployed to WMF wikis with 1.23wmf19, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap#Schedule_for_the_deployments for the schedule.

Also, the change to the wildcard handling is going out with 1.23wmf18 (which means it's already live on mediawiki.org and the test wikis).

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


Navigation
Links