Page MenuHomePhabricator

Lua module broken because of incompatibility between SerializerFactory and EntitySerializer
Closed, ResolvedPublic

Description

SerializerFactory::newSerializerForObject optionally takes a SerializationOptions object. EntitySerializer however requires an EntitySerializerObject.

Scribunto_LuaWikibaseLibrary calls newSerializerForObject with no options set, which causes a fatal error when trying to instantiate an EntitySerializer.

The issue however is more general: If SerializerFactory takes a generic options object, but some of the serializers require a specialized options object, the caller of the factory function would have to know in advance what kind of object will be constructed.

In fact, any knowledge about the needs and requirements of any of the objects the factory may create essentially renders the factory pointless. For the factory to be useful, it must only request very generic information from the caller.


Version: unspecified
Severity: blocker

Details

Reference
bz49878

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:41 AM
bzimport set Reference to bz49878.
bzimport added a subscriber: Unknown Object (MLST).
daniel created this task.Jun 20 2013, 2:40 PM

https://gerrit.wikimedia.org/r/69676 (Gerrit Change I4762ad35a43cc2d6e3b8efae75762bcb782e33e2) | change APPROVED and MERGED [by jenkins-bot]

Verified Wikidata demo sprint 22-9