Page MenuHomePhabricator

ContentHandlerSanityTest assumes every handler can create empty content, but Wikibase can't
Closed, ResolvedPublic

Description

ContentHandlerSanityTest test case testMakeEmptyContent assumes that every content handler can create empty content. Wikibase, however, produces this exception:

MWException: Cannot make an empty EntityContent, since we require at least an ID to be set.

This needs to be reconciled by either removing the assumption on the test or fixing the wikibase content handler to be able to produce it.

Related Objects

StatusAssignedTask
ResolvedWikidata-bugs
OpenNone
Resolvedaude
ResolvedSmalyshev
Resolvedaude
ResolvedNone
InvalidNone
ResolvedSmalyshev
ResolvedLydia_Pintscher
DuplicateSmalyshev
DuplicateNone
DeclinedNone
DeclinedNone
Resolveddaniel
ResolvedLydia_Pintscher
OpenNone
DeclinedNone
ResolvedSmalyshev
ResolvedSmalyshev
DeclinedNone
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
Resolveddcausse
Resolveddcausse
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
Resolveddcausse

Event Timeline

Change 337029 had a related patch set uploaded (by Daniel Kinzler):
Support creation of empty entities.

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

While en empty EntityContent object doesn't make much sense, it's useful to be able to create them e.g. to be able to create diffs consistently. MW core creates empty Content objects in a few places to allow for a consistent code path in the absense of an actual Content object.

Change 338023 had a related patch set uploaded (by Smalyshev):
Check that empty content is valid only on handlers that allow direct editing.

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

Change 338023 merged by jenkins-bot:
Check that empty content is valid only on handlers that allow direct editing.

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

Change 337029 merged by jenkins-bot:
Support creation of empty entities.

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

Smalyshev closed this task as Resolved.Feb 16 2017, 8:41 PM
Smalyshev claimed this task.

Change 356228 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Allow makeEmptyContent to return null for some kinds of content.

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

Change 356228 abandoned by Daniel Kinzler:
Allow makeEmptyContent to throw MWException for some kinds of content.

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