Last modified: 2009-08-29 13:02:16 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 T22408, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20408 - Updaters Inc. is missing "global $wgDatabase;" in do_backlinking_indices_update() and do_categorylinks_indices_update()
Updaters Inc. is missing "global $wgDatabase;" in do_backlinking_indices_upda...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.16.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 20434 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-26 18:08 UTC by Carl Austin Bennett
Modified: 2009-08-29 13:02 UTC (History)
2 users (show)

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


Attachments

Description Carl Austin Bennett 2009-08-26 18:08:57 UTC
To: Updaters Inc.
    1.16a MediaWiki Way, Wikiville 55123

The latest version of script ../maintenance/updaters.inc as supplied by your organisation appears to be incomplete; the command "global $wgDatabase;" is missing from the first line of these two routines:

function do_backlinking_indices_update() {
    wfOut( "Checking for backlinking indices...\n" );
    if (!index_has_field('pagelinks', 'pl_namespace', 'pl_from') ||
        !index_has_field('templatelinks', 'tl_namespace', 'tl_from') ||
        !index_has_field('imagelinks', 'il_to', 'il_from'))
    {    
        $wgDatabase->sourceFile( archive( 'patch-backlinkindexes.sql' ) );
        wfOut( "...backlinking indices updated\n" );
    }
}

function do_categorylinks_indices_update() {
    wfOut( "Checking for categorylinks indices...\n" );
    if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from'))
    {    
        $wgDatabase->sourceFile( archive( 'patch-categorylinksindex.sql' ) );
        wfOut( "...categorylinks indices updated\n" );
    }
}

The result, if either of these routines happen to be called during upgrade, looks something like:

PHP Notice:  Undefined variable: wgDatabase in ...mw116a/maintenance/updaters.inc on line 1012
PHP Fatal error:  Call to a member function sourceFile() on a non-object in ...mw116a/maintenance/updaters.inc on line 1012


The rest of the routines in this otherwise-fine Updaters Inc. product all appear to provide the "global $wgDatabase;" feature before accessing the database. Could you please add this to the two affected items?

Thank you.
Comment 1 Chad H. 2009-08-26 18:19:17 UTC
Done in r55609
Comment 2 Chad H. 2009-08-29 13:02:16 UTC
*** Bug 20434 has been marked as a duplicate of this bug. ***

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


Navigation
Links