Last modified: 2013-01-06 11:42:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21148, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19148 - SmoothGallery: Call to a member function getText() on a non-object
SmoothGallery: Call to a member function getText() on a non-object
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SmoothGallery (Other open bugs)
unspecified
All All
: Normal critical (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-10 16:30 UTC by Gregor Hagedorn
Modified: 2013-01-06 11:42 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gregor Hagedorn 2009-06-10 16:30:19 UTC
(Note: SmoothGallery is not in the bugzilla component list)

When calling SmoothGallery 1.1e under MediaWiki 1.16alpha (r51492), it works when both filenames and descriptions are present:

{{#sgallery: imagelist=File:Aconitum-napellus 4435.jpg{{!}}''Aconitum napellus'', Infloreszenz
File:Aconitum_napellus2_ies.jpg{{!}}''Aconitum napellus'', from side
File:Aconitum_napellus3_ies.jpg{{!}}''Aconitum napellus'', inside
File:Aconitum_napellus8_ies.jpg{{!}}''Aconitum napellus'', leaves
}}

but when leaving away the description:

{{#sgallery: imagelist=File:Aconitum-napellus 4435.jpg
File:Aconitum_napellus2_ies.jpg
File:Aconitum_napellus3_ies.jpg
File:Aconitum_napellus8_ies.jpg
}}

the page is no longer rendered at all, and the error message:

Fatal error: Call to a member function getText() on a non-object in ...mediawiki/extensions/SmoothGallery/SmoothGalleryParser.php on line 247

is shown.

On http://www.ryandlane.com/sandbox/SmoothGallery is works ok under 1.15.0rc1 (r51439), so the bug seems to be 1.16-specific.
Comment 1 Gregor Hagedorn 2009-06-11 22:03:20 UTC
Update: The error is probably not related to 1.16, but to using a shared repository.

If no image description is provided, ''and'' the image comes from a shared repository that uses API connection (such as using images from Wikimedia Commons), then the following code in SmoothGalleryParser fails with a fatal error:

 if ( $description == '' ) {
  // Load the image page from the database with the provided title from the image object
  $db = wfGetDB( DB_SLAVE );
  $img_rev = Revision::loadFromTitle( $db, $title );
  // Get the text from the image page's description
  $description = $img_rev->getText();
 }
Comment 2 Chad H. 2009-06-11 22:28:48 UTC
Fixed in r51766.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links