Page MenuHomePhabricator

Fatal error: Call to a member function getCommonMetaArray() on a non-object at File.php on line 586
Closed, ResolvedPublic

Description

[07-Jan-2014 19:37:04] Fatal error: Call to a member function getCommonMetaArray() on a non-object at /usr/local/apache/common-local/php-1.23wmf9/includes/filerepo/file/File.php on line 586
Server: mw1116
Method: GET
URL: http://commons.wikimedia.org/w/api.php?titles=File%3AAu_clair_de_la_lune_mode_do.mid&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata%7Cmime%7Cmediatype%7Cextmetadata&prop=imageinfo&iimetadataversion=2&iiextmetadatamultilang=1&format=json&action=query&redirects=true&uselang=tr
Backtrace:
#0 /usr/local/apache/common-local/php-1.23wmf9/includes/filerepo/file/File.php(586): File::getCommonMetaArray()
#1 /usr/local/apache/common-local/php-1.23wmf9/includes/media/FormatMetadata.php(1689): File->getCommonMetaArray()
#2 /usr/local/apache/common-local/php-1.23wmf9/includes/media/FormatMetadata.php(1623): FormatMetadata->getExtendedMetadataFromFile(Object(LocalFile))
#3 /usr/local/apache/common-local/php-1.23wmf9/includes/api/ApiQueryImageInfo.php(463): FormatMetadata->fetchExtendedMetadata(Object(LocalFile))
#4 /usr/local/apache/common-local/php-1.23wmf9/includes/api/ApiQueryImageInfo.php(158): ApiQueryImageInfo::getInfo(Object(LocalFile), Array, Object(ApiResult), NULL, Array)
#5 /usr/local/apache/common-local/php-1.23wmf9/includes/api/ApiQuery.php(278): ApiQueryImageInfo->execute()
#6 /usr/local/apache/common-local/php-1.23wmf9/includes/api/ApiMain.php(862): ApiQuery->execute()
#7 /usr/local/apache/common-local/php-1.23wmf9/includes/api/ApiMain.php(387): ApiMain->executeAction()
#8 /usr/local/apache/common-local/php-1.23wmf9/includes/api/ApiMain.php(358): ApiMain->executeActionWithErrorHandling()
#9 /usr/local/apache/common-local/php-1.23wmf9/api.php(76): ApiMain->execute()
#10 /usr/local/apache/common-local/w/api.php(3): require('/usr/local/apac...')
#11 {main}


Version: unspecified
Severity: normal

Details

Reference
bz59785

Event Timeline

bzimport raised the priority of this task from to High.
bzimport set Reference to bz59785.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Jan 7 2014, 7:43 PM
Reedy added a comment.Jan 7 2014, 7:59 PM

Occurs in wmf8 too

Reedy added a comment.Jan 7 2014, 8:01 PM

At a quick glance, this is apparently already guarded against (in master at least)

		if ( $common !== false ) {
			foreach ( $common as $key => $value ) {
				$fileMetadata[$key] = array(
					'value' => $value,
					'source' => 'file-metadata',
				);
			}
Reedy added a comment.Jan 7 2014, 8:02 PM

(In reply to comment #2)

At a quick glance, this is apparently already guarded against (in master at
least)

if ( $common !== false ) {
    foreach ( $common as $key => $value ) {
        $fileMetadata[$key] = array(
            'value' => $value,
            'source' => 'file-metadata',
        );
    }

Ignore that

getHandler can return false

/**

  • Like getMetadata but returns a handler independent array of common values.
  • @see MediaHandler::getCommonMetaArray()
  • @return array|bool Array or false if not supported
  • @since 1.23
	 */

public function getCommonMetaArray() {

		$handler = $this->getHandler();

		return $handler->getCommonMetaArray( $this );

}

Change 105998 had a related patch set uploaded by Reedy:
Call to a member function getCommonMetaArray() on a non-object at File.php on line 586

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

Change 106007 had a related patch set uploaded by Reedy:
Call to a member function getCommonMetaArray() on a non-object at File.php on line 586

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

Change 106009 had a related patch set uploaded by Reedy:
Call to a member function getCommonMetaArray() on a non-object at File.php on line 586

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

Change 106009 merged by Reedy:
Call to a member function getCommonMetaArray() on a non-object at File.php on line 586

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

Change 106007 merged by jenkins-bot:
Call to a member function getCommonMetaArray() on a non-object at File.php on line 586

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

Change 105998 merged by jenkins-bot:
Call to a member function getCommonMetaArray() on a non-object at File.php on line 586

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

Gilles moved this task from Untriaged to Done on the Multimedia board.Dec 4 2014, 10:11 AM
Gilles raised the priority of this task from High to Unbreak Now!.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:23 AM