Page MenuHomePhabricator

Merge AssertEdit extension into MediaWiki core
Closed, ResolvedPublic

Description

Trivial extension, should really just exist in core.

Will see around to getting it done


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=53106

Details

Reference
bz27841

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:32 PM
bzimport set Reference to bz27841.

Change 90263 had a related patch set uploaded by Legoktm:
Merge AssertEdit extension into core

https://gerrit.wikimedia.org/r/90263

Change 90263 merged by jenkins-bot:
Merge AssertEdit extension into core

https://gerrit.wikimedia.org/r/90263

(In reply to comment #5)

https://www.mediawiki.org/wiki/Extension:AssertEdit needs updating.

Done. I also created [[mw:API:Assert]] to document the core functionality but I'm not really sure where to link it from.

(In reply to comment #6)

(In reply to comment #5)

https://www.mediawiki.org/wiki/Extension:AssertEdit needs updating.

Done. I also created [[mw:API:Assert]] to document the core functionality but
I'm not really sure where to link it from.

Thanks! I updated [[mw:Template:API]] and added the template to [[mw:API:Assert]]. I also linked this new API page from the extension notice at [[mw:Extension:AssertEdit]].

Unintended consequence: passing a blank assert= parameter to the API now causes an unknown_assert error, whereas before it was silently ignored. Bug or feature?

(In reply to comment #8)

Unintended consequence: passing a blank assert= parameter to the API now
causes
an unknown_assert error, whereas before it was silently ignored. Bug or
feature?

I don't consider this to be a bug since you shouldn't be passing blank parameters like that so I guess it can be considered a "feature".

(In reply to comment #9)

(In reply to comment #8)

Unintended consequence: passing a blank assert= parameter to the API now
causes
an unknown_assert error, whereas before it was silently ignored. Bug or
feature?

I don't consider this to be a bug since you shouldn't be passing blank
parameters like that so I guess it can be considered a "feature".

Fair enough. Can we have a "blank_assert" (or somesuch) rather than "unknown_assert" then? This is a breaking change to some reusers, so giving them more debug information may be helpful.

The error is coming from the API parameter parsing, before it ever gets to the point where the assert code sees it. I'm inclined to say "no" here, since the documented values are "bot" or "user" ("" is not included) and the error message is correct.

(In reply to comment #11)

The error is coming from the API parameter parsing, before it ever gets to
the point where the assert code sees it.

I don't really care a great deal, I just noted that it was an (unintended?) change in behaviour that has already forced several API users to rewrite (admittedly lazy) code. Incidentally https://www.mediawiki.org/wiki/API:Assert could do with expansion on this point.