Michael created this task.
Michael added projects: Wikidata, Wikidata Dev Team (Wikidata.org Slice).
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  As an alternative to T350136 <https://phabricator.wikimedia.org/T350136> and 
T349686 <https://phabricator.wikimedia.org/T349686> (and their respective 
branches), the suggestion came up to start introducing the changes at one level 
higher up and introduce a `PseudoEntityIdValue` instead.
  
  This would essential mean that the callback for `'wikibase-entityid'` in the 
`'WikibaseRepo.DataValueDeserializer'` service would return either an 
`EntityIdValue` or a `PseudoEntityIdValue` (name TBD). We need to explore what 
changes would follow from that starting point.
  
  name=WikibaseRepo.ServiceWiring.php
        'WikibaseRepo.DataValueDeserializer' => function ( MediaWikiServices 
$services ): DataValueDeserializer {
                return new DataValueDeserializer( [
                        'string' => StringValue::class,
                        'unknown' => UnknownValue::class,
                        'globecoordinate' => GlobeCoordinateValue::class,
                        'monolingualtext' => MonolingualTextValue::class,
                        'quantity' => QuantityValue::class,
                        'time' => TimeValue::class,
                        'wikibase-entityid' => static function ( $value ) use ( 
$services ) {
                                // TODO this should perhaps be factored out 
into a class
                                if ( isset( $value['id'] ) ) {
                                        try {
                                                return new EntityIdValue( 
WikibaseRepo::getEntityIdParser( $services )->parse( $value['id'] ) );
                                        } catch ( EntityIdParsingException 
$parsingException ) {
                                                if ( is_string( $value['id'] ) 
) {
                                                        $message = 'Can not 
parse id \'' . $value['id'] . '\' to build EntityIdValue with';
                                                } else {
                                                        $message = 'Can not 
parse id of type ' . gettype( $value['id'] ) . ' to build EntityIdValue with';
                                                }
                                                throw new 
InvalidArgumentException(
                                                        $message,
                                                        0,
                                                        $parsingException
                                                );
                                        }
                                } else {
                                        return EntityIdValue::newFromArray( 
$value );
                                }
                        },
                ] );
        },
  
  **acceptance criteria:**
  
  [ ] a prototype exists that explores this approach that  can serve as input 
for further considerations

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

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

To: Michael
Cc: Aklapper, Michael, Danny_Benjafield_WMDE, Astuthiodit_1, karapayneWMDE, 
Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to