Jump to content

Topic on Extension talk:RefreshSiteStatsTable

Extension causes Special pages issue

2
Summary by WikiForMen

Issue is fixed and resolved!

Ulf Dunkel (talkcontribs)

I installed the extension and ran /maintenance/initSiteStats.php. Afterwards, I can no longer access my Special pages. How can I fix this?

[b4c6d34049607e99d031d12d] /wiki/Sp%C3%A9cial:Pages_sp%C3%A9ciales Error from line 32 of /var/www/vhosts/intactiwiki.org/w/pool/extensions/RefreshSiteStatsTable/includes/SpecialRefreshSiteStatsTable.php: Class 'DBConnect' not found Backtrace:

  1. 0 /var/www/vhosts/intactiwiki.org/w/fr/includes/specialpage/SpecialPageFactory.php(402): RefreshSiteStatsTable\SpecialRefreshSiteStatsTable->__construct()
#1 /var/www/vhosts/intactiwiki.org/w/fr/includes/specialpage/SpecialPageFactory.php(432): MediaWiki\Special\SpecialPageFactory->getPage()
#2 /var/www/vhosts/intactiwiki.org/w/fr/includes/specials/SpecialSpecialpages.php(56): MediaWiki\Special\SpecialPageFactory->getUsablePages()
#3 /var/www/vhosts/intactiwiki.org/w/fr/includes/specials/SpecialSpecialpages.php(44): SpecialSpecialpages->getPageGroups()
#4 /var/www/vhosts/intactiwiki.org/w/fr/includes/specialpage/SpecialPage.php(569): SpecialSpecialpages->execute()
#5 /var/www/vhosts/intactiwiki.org/w/fr/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run()
#6 /var/www/vhosts/intactiwiki.org/w/fr/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath()
#7 /var/www/vhosts/intactiwiki.org/w/fr/includes/MediaWiki.php(860): MediaWiki->performRequest()
#8 /var/www/vhosts/intactiwiki.org/w/fr/includes/MediaWiki.php(517): MediaWiki->main()
#9 /var/www/vhosts/intactiwiki.org/w/fr/index.php(42): MediaWiki->run()
#10 {main}
WikiForMen (talkcontribs)

The extension was tested with mw 1.25, 1.27, 1.31, 1.33 and 1.35. You are using mw 1.32, but it would be a big surprise if that should be an issue.

So I built a test environment with version 1.32.

1. Installing mw 1.32.2.

2. Copy an outdated DB.

3. Run

php _test.wima/maintenance/update.php

4. Updating the field ss_good_articles in the table site_stats to 4711.

5. Run

php _test.wima/maintenance/initSiteStats.php --update

Results:

$ php _test.wima/maintenance/initSiteStats.php --update
Refresh Site Statistics

Counting total edits...11339
Counting number of articles...5400
Counting total pages...8902
Counting number of users...4
Counting number of images...885

Updating site statistics...done.

Done.

Uups. This is strange. The counting number of articles should be 5412.

6. Call https://test.wikimannia.org/Special:RefreshSiteStatsTable

Results:

Number of good articles
determined from DB query: 5412
read out of statistic field: 5400
State: incorrect

7. Do "OK" and recall https://test.wikimannia.org/Special:RefreshSiteStatsTable

Results:

Number of good articles
determined from DB query: 5412
read out of statistic field: 5412
State: correct

8. See:

Results:

"Content pages: 5,412"

9. Call https://test.wikimannia.org/index.php?title=Special:PopularPages&limit=100&offset=5400

Results:

"Showing below up to 12 results in range #5,401 to #5,412."

As aspected! :-) There are 5,412 articles in that DB!

So the extension does better than the maintenance script. ;-)

So all works fine even with mw 1.32. --WikiForMen (talk) 16:33, 8 April 2021 (UTC)


Uups! I finally found the issue! I used the class DBConnect in the CountingMarker extension to avoid backward compatibility issues. And since I'm always using both extensions at the same time, I didn't notice that the RefreshSiteStatsTable extension was using a class from another extension. :-(

I kicked out class DBConnect in version 1.1.1 and now it is doing well. Sorry for my sloppiness and the inconvenience it caused.--WikiForMen (talk) 16:33, 8 April 2021 (UTC)