[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Page MenuHomePhabricator

API action=query&list=filearchive&faprop=metadata gives no metadata and possible warning for LocalRepo with 'useJsonMetadata' option (like wmf)
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

No metadata are shown and a php notice is emitted (Notice: unserialize(): Error at offset 0 of 718 bytes)

Reason:

ApiQueryFilearchive.php
			if ( $fld_metadata && $canViewFile ) {
				$file['metadata'] = $row->fa_metadata
					? ApiQueryImageInfo::processMetaData( unserialize( $row->fa_metadata ), $result )
					: null;
			}

The unserialize no longer works for JSON stored metadata. The code from LocalFile::loadMetadataFromDbFieldValue needs to be called

What should have happened instead?:
Metadata should be shown. If used together with 'useSplitMetadata' => true, the metadata may loaded from external source as well.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
The json metadata was build for T275268

The api part for non-deleted files prop=imageinfo is using File::getMetadataArray and is not effected

Event Timeline

Ugh, it's more complicated than it looks as ArchivedFile is not a subclass of (or has any relationship with) LoclaFile. You can create the object but it's useless...

Change 773947 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] Make ArchivedFile subclass of LocalFile

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

Change 776214 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] file: Move json metadata storage out of LocalFile

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

Change 776214 merged by jenkins-bot:

[mediawiki/core@master] file: Move json metadata storage out of LocalFile

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

Change 778219 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] filerepo: Duplicate code handling metadata of files to ArchivedFile

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

Change 778219 merged by jenkins-bot:

[mediawiki/core@master] filerepo: Duplicate code handling metadata of files to ArchivedFile

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

Ladsgroup claimed this task.
Ladsgroup edited projects, added DBA; removed Patch-For-Review.
Ladsgroup moved this task from Triage to Done on the DBA board.

Change 773947 abandoned by Ladsgroup:

[mediawiki/core@master] [WIP] Make ArchivedFile subclass of LocalFile

Reason:

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