Page MenuHomePhabricator

Statements with data type "form" cannot be saved on top-level entities
Closed, ResolvedPublic5 Story Points

Description

Discovered when testing T165579.

Attempting to add a statement with data type "form" on a form/item/property fails with "Could not save due to an error. [3f83348963955a7463632683] Exception caught: The given ID does not refer to an entity of type lexeme"

Clues:
The SetClaim request calls ReferencedEntitiesDataUpdater::addLinksToParserOutput when saving the property which in turn attempts to do an EntityTitleLookup and calls EntityHandler::getTitleForId on the LexemeHandler with a FormId at which point it breaks because it expected a LexemeId.

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptApr 23 2018, 11:06 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Next problem that occurs when working around the EntityTitleLookup issue: TL;DR The request saving the statement on the property hits SqlEntityInfoBuilder which calls getNumericId on the FormId.

Internal Server Error
[4c8887adf6f28f77c52636d3] /mediawiki/api.php   Error from line 326 of /var/www/mediawiki/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php: Call to undefined method Wikibase\Lexeme\DataModel\FormId::getNumericId()
Backtrace:
#0 /var/www/mediawiki/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php(208): Wikibase\Lib\Store\Sql\SqlEntityInfoBuilder->updateEntityInfo(Wikibase\Lexeme\DataModel\FormId)
#1 /var/www/mediawiki/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php(170): Wikibase\Lib\Store\Sql\SqlEntityInfoBuilder->setEntityIds(array)
#2 /var/www/mediawiki/extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilderFactory.php(92): Wikibase\Lib\Store\Sql\SqlEntityInfoBuilder->__construct(Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParser, Wikibase\DataModel\Services\EntityId\EntityIdComposer, Wikibase\Lib\Store\EntityNamespaceLookup, array, boolean, string)
#3 /var/www/mediawiki/extensions/Wikibase/lib/includes/Store/DispatchingEntityInfoBuilderFactory.php(51): Wikibase\Lib\Store\Sql\SqlEntityInfoBuilderFactory->newEntityInfoBuilder(array)
#4 /var/www/mediawiki/extensions/Wikibase/repo/includes/ParserOutput/EntityParserOutputGenerator.php(206): Wikibase\Lib\Store\DispatchingEntityInfoBuilderFactory->newEntityInfoBuilder(array)
#5 /var/www/mediawiki/extensions/Wikibase/repo/includes/ParserOutput/EntityParserOutputGenerator.php(155): Wikibase\Repo\ParserOutput\EntityParserOutputGenerator->getEntityInfo(ParserOutput)
#6 /var/www/mediawiki/extensions/Wikibase/repo/includes/Content/EntityContent.php(267): Wikibase\Repo\ParserOutput\EntityParserOutputGenerator->getParserOutput(Wikibase\DataModel\Entity\Property, boolean)
#7 /var/www/mediawiki/extensions/Wikibase/repo/includes/Content/EntityContent.php(213): Wikibase\EntityContent->getParserOutputFromEntityView(NULL, ParserOptions, boolean)
#8 /var/www/mediawiki/includes/page/WikiPage.php(2129): Wikibase\EntityContent->getParserOutput(Title, NULL, ParserOptions)
#9 /var/www/mediawiki/includes/page/WikiPage.php(1655): WikiPage->prepareContentForEdit(Wikibase\PropertyContent, NULL, User, string, boolean)
#10 /var/www/mediawiki/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(292): WikiPage->doEditContent(Wikibase\PropertyContent, string, integer, integer, User)
#11 /var/www/mediawiki/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(190): Wikibase\Repo\Store\WikiPageEntityStore->saveEntityContent(Wikibase\PropertyContent, string, User, integer, integer)
#12 /var/www/mediawiki/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityStore.php(87): Wikibase\Repo\Store\WikiPageEntityStore->saveEntity(Wikibase\DataModel\Entity\Property, string, User, integer, integer)
#13 /var/www/mediawiki/extensions/Wikibase/repo/includes/EditEntity.php(712): Wikibase\Lib\Store\TypeDispatchingEntityStore->saveEntity(Wikibase\DataModel\Entity\Property, string, User, integer, integer)
#14 /var/www/mediawiki/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(350): Wikibase\EditEntity->attemptSave(Wikibase\DataModel\Entity\Property, string, integer, string)
#15 /var/www/mediawiki/extensions/Wikibase/repo/includes/Api/SetClaim.php(137): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity(Wikibase\DataModel\Entity\Property, string)
#16 /var/www/mediawiki/includes/api/ApiMain.php(1579): Wikibase\Repo\Api\SetClaim->execute()
#17 /var/www/mediawiki/includes/api/ApiMain.php(535): ApiMain->executeAction()
#18 /var/www/mediawiki/includes/api/ApiMain.php(506): ApiMain->executeActionWithErrorHandling()
#19 /var/www/mediawiki/api.php(83): ApiMain->execute()
#20 {main}
WMDE-leszek set the point value for this task to 3.Apr 24 2018, 3:04 PM
WMDE-leszek triaged this task as High priority.
WMDE-leszek changed the point value for this task from 3 to 5.

Léa and I just saw the same thing happening when adding a statement on the Lexeme-level of a Lexeme. It was fine on a Form.

WMDE-leszek updated the task description. (Show Details)Apr 25 2018, 10:59 AM
Addshore updated the task description. (Show Details)Apr 26 2018, 9:06 AM
Jakob_WMDE renamed this task from Statements with data type "form" cannot be saved on properties to Statements with data type "form" cannot be saved on top-level entities.Apr 27 2018, 12:08 PM
Jakob_WMDE updated the task description. (Show Details)
Lydia_Pintscher closed this task as Resolved.May 2 2018, 8:35 AM
Lydia_Pintscher claimed this task.