Page MenuHomePhabricator

[Task] Create mediainfo entity on demand when saving the first time after editing labels, descriptions and aliases
Closed, ResolvedPublic

Description

This ticket is about creating a mediainfo entity on demand when hitting save the first time after adding labels, descriptions and/or aliases. A related task is T140760 to create a mediainfo entity on demand when adding a statement the first time.

Related Objects

Event Timeline

There are several places where the "on the fly" creation could be handled:

  1. in the client side JS code. It would know when an entity needs to be created with an extra call to wbeditentity before saving an edit.
  2. in the API module (more precisely, the ModifyEntity base class).
  3. in the EditEntity interactor.
  4. in the EntityStore.
  5. in the EntityRevisionLookup, on read, if in a POST request.

I personally tend towards doing this in the API, but there are good arguments for the other places, too. In particular, it's still unclear to me where we should maintain the knowledge about which entity types can be created on the fly, and which can't.

We should further consider whether we want to treat a MediaInfo entity as "existing" (in the context of EntityLookup, Special:EntityData, wbgetentities API calls, etc), when the corresponding File page exists, but no page was yet created for the MediaInfo entity.

daniel moved this task from Proposed to Doing on the Wikidata-Sprint-2016-05-10 board.
daniel moved this task from Doing to Proposed on the Wikidata-Sprint-2016-05-10 board.
daniel moved this task from Proposed to Doing on the Wikidata-Sprint-2016-05-24 board.

Change 293339 had a related patch set uploaded (by Daniel Kinzler):
[WIP] Allow auto-creation of entities with custom ids.

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

Change 294350 had a related patch set uploaded (by Daniel Kinzler):
Allow auto-creation of MediaInfo entities.

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

Change 294365 had a related patch set uploaded (by Daniel Kinzler):
Allow entities to be created from all API modules.

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

Change 296602 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Fixups to auto-creation of entities with custom ids

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

Tobi_WMDE_SW renamed this task from [Task] Create mediainfo entity on demand when saving the first time to [Task] Create mediainfo entity on demand when saving the first time after editing labels, descriptions and aliases.Jul 19 2016, 2:16 PM
Tobi_WMDE_SW removed daniel as the assignee of this task.
Tobi_WMDE_SW assigned this task to daniel.
Tobi_WMDE_SW updated the task description. (Show Details)
Tobi_WMDE_SW updated the task description. (Show Details)

Change 294350 merged by jenkins-bot:
Allow auto-creation of MediaInfo entities.

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

On Ia5f075eb3f1b, @adrianheine briedfly documented a discussion we had:

We had a discussion. Proposal is to have a getEntityForCreation or getEntityForEditing method on EntityStore
that takes the new parameter, id parameter and for properties the dataType part of the POST body.

I agree that this would be cleaner than my original proposal. Since the original patch got merged now, I decided to copy this here as a todo, so it doesn't get lost.

@Jonas the patch you're pointing to is already the next step - see T140760. I've just updated the commit message.
I think everything related to this task has been done now, right?

Jonas moved this task from Review to Done on the Wikidata-Sprint-2016-07-19 board.
Jonas moved this task from Done to Review on the Wikidata-Sprint-2016-07-19 board.

Change 294365 had a related patch set uploaded (by Jonas Kress (WMDE)):
Allow entities to be created from more API modules.

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

Change 293339 merged by jenkins-bot:
Allow auto-creation of entities with custom ids.

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

Change 294365 had a related patch set uploaded (by Jonas Kress (WMDE)):
Allow entities to be created from more API modules.

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

Change 296602 merged by jenkins-bot:
Fixups to auto-creation of entities with custom ids

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

Change 294365 merged by jenkins-bot:
Allow entities to be created from more API modules.

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

Jonas moved this task from Review to Done on the Wikidata-Sprint-2016-07-19 board.