Lucas_Werkmeister_WMDE added a comment.

The null ID in the response is a big hint to what’s happening: ResultBuilder is trying to serialize a NullFormId or DummyFormId. Both of those classes override serialize():

public function serialize() {
	throw new LogicException( 'Shall never be called' );
}

But they don’t override getSerialization(), and that’s the function which ResultBuilder uses, so it just sees the uninitialized internal serialization field: hence the null. If you copy the serialize() implementation to getSerialization(), you get an error response instead (from DummyFormId, not NullFormId, for what it’s worth).

So I assume that when the initial BlankForm is turned into a real Form in Lexeme::addOrUpdateForm(), the real Form is never returned back to EditEntity/ModifyEntity. You can see this in the implementation of wbladdform as well, in fact – AddForm::getFormWithMaxId() does some ugly acrobatics to get the form that was just created:

private function getFormWithMaxId( Lexeme $lexeme ) {
	// TODO: This is all rather nasty
	$maxIdNumber = $lexeme->getForms()->maxFormIdNumber();
	// TODO: Use some service to get the ID object!
	$formId = new FormId( $lexeme->getId() . '-F' . $maxIdNumber );
	return $lexeme->getForm( $formId );
}

TASK DETAIL
https://phabricator.wikimedia.org/T200255

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Mringgaard, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Wikidata-bugs, aude, Darkdadaah, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to