Last modified: 2012-10-11 23:31:27 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 T41108, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39108 - PageTriage Undefined index: user_name
PageTriage Undefined index: user_name
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
PageCuration (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-07 18:59 UTC by Sam Reed (reedy)
Modified: 2012-10-11 23:31 UTC (History)
3 users (show)

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


Attachments

Description Sam Reed (reedy) 2012-08-07 18:59:50 UTC
Noticed while running unit tests

PHP Notice:  Undefined index: user_name in /var/www/wiki/mediawiki/extensions/PageTriage/includes/PageTriageUtil.php on line 313
PHP Stack trace:
PHP   1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:103
PHP   3. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:45
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   8. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP   9. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:772
PHP  10. PHPUnit_Framework_TestCase->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:75
PHP  11. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:751
PHP  12. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:649
PHP  13. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:804
PHP  14. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:942
PHP  15. ApiBlockTest->testMakeNormalBlock() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiBlockTest.php:0
PHP  16. ApiTestCase->doApiRequest() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiBlockTest.php:59
PHP  17. ApiMain->execute() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiTestCase.php:68
PHP  18. ApiMain->executeAction() /var/www/wiki/mediawiki/core/includes/api/ApiMain.php:345
PHP  19. ApiBlock->execute() /var/www/wiki/mediawiki/core/includes/api/ApiMain.php:805
PHP  20. SpecialBlock::processForm() /var/www/wiki/mediawiki/core/includes/api/ApiBlock.php:91
PHP  21. wfRunHooks() /var/www/wiki/mediawiki/core/includes/specials/SpecialBlock.php:708
PHP  22. Hooks::run() /var/www/wiki/mediawiki/core/includes/GlobalFunctions.php:3907
PHP  23. call_user_func_array() /var/www/wiki/mediawiki/core/includes/Hooks.php:216
PHP  24. PageTriageHooks::onBlockIpComplete() /var/www/wiki/mediawiki/core/includes/Hooks.php:0
PHP  25. PageTriageUtil::updateMetadataOnBlockChange() /var/www/wiki/mediawiki/extensions/PageTriage/PageTriage.hooks.php:416

Notice: Undefined index: user_name in /var/www/wiki/mediawiki/extensions/PageTriage/includes/PageTriageUtil.php on line 313

Call Stack:
    0.0007     669616   1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
    1.5330   22398104   2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:103
    1.5332   22413904   3. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:45
    4.5863  125378584   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192
    4.6106  125931048   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325
    4.6109  125932656   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   68.4595  203159400   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   68.4596  203160376   8. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
   68.4596  203160376   9. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:772
   68.6458  203171312  10. PHPUnit_Framework_TestCase->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:75
   68.6460  203171312  11. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:751
   68.6499  203173024  12. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:649
   69.1646  205841736  13. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:804
   69.1646  205843800  14. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:942
   69.1646  205843856  15. ApiBlockTest->testMakeNormalBlock() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiBlockTest.php:0
   69.4335  207161536  16. ApiTestCase->doApiRequest() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiBlockTest.php:59
   69.4339  207206096  17. ApiMain->execute() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiTestCase.php:68
   69.4339  207206176  18. ApiMain->executeAction() /var/www/wiki/mediawiki/core/includes/api/ApiMain.php:345
   69.4394  207339936  19. ApiBlock->execute() /var/www/wiki/mediawiki/core/includes/api/ApiMain.php:805
   69.4582  207761152  20. SpecialBlock::processForm() /var/www/wiki/mediawiki/core/includes/api/ApiBlock.php:91
   69.5083  207826944  21. wfRunHooks() /var/www/wiki/mediawiki/core/includes/specials/SpecialBlock.php:708
   69.5084  207826944  22. Hooks::run() /var/www/wiki/mediawiki/core/includes/GlobalFunctions.php:3907
   69.5088  207868152  23. call_user_func_array() /var/www/wiki/mediawiki/core/includes/Hooks.php:216
   69.5088  207868768  24. PageTriageHooks::onBlockIpComplete() /var/www/wiki/mediawiki/core/includes/Hooks.php:0
   69.5208  208022560  25. PageTriageUtil::updateMetadataOnBlockChange() /var/www/wiki/mediawiki/extensions/PageTriage/PageTriage.hooks.php:416
Comment 1 bsitu 2012-08-08 00:35:05 UTC
The unit test for PageTriage is out of date, :(

I will manage some time later this week to update them
Comment 2 Sam Reed (reedy) 2012-09-11 21:02:51 UTC
Any chance you can get these fixed up Benny? Thanks!
Comment 3 bsitu 2012-09-18 23:19:25 UTC
At a quick glance, I thought it's the unit test from pagetriage, :)

Does the test environment have all the tags populated in pagetriage_tags table?
Comment 4 Sam Reed (reedy) 2012-09-18 23:28:29 UTC
mysql> explain mw_pagetriage_tags;
+---------------+------------------+------+-----+---------+----------------+
| Field         | Type             | Null | Key | Default | Extra          |
+---------------+------------------+------+-----+---------+----------------+
| ptrt_tag_id   | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| ptrt_tag_name | varbinary(20)    | NO   | UNI | NULL    |                |
| ptrt_tag_desc | varbinary(255)   | NO   |     | NULL    |                |
+---------------+------------------+------+-----+---------+----------------+
3 rows in set (0.01 sec)

mysql> select count(*) from mw_pagetriage_tags;
+----------+
| count(*) |
+----------+
|       16 |
+----------+
1 row in set (0.01 sec)

mysql> select * from mw_pagetriage_tags;
+-------------+--------------------+--------------------------------+
| ptrt_tag_id | ptrt_tag_name      | ptrt_tag_desc                  |
+-------------+--------------------+--------------------------------+
|           1 | linkcount          | Number of inbound links        |
|           2 | category_count     | Category mapping count         |
|           3 | csd_status         | CSD status                     |
|           4 | prod_status        | PROD status                    |
|           5 | blp_prod_status    | BLP PROD status                |
|           6 | afd_status         | AFD status                     |
|           7 | rev_count          | Number of edits to the article |
|           8 | page_len           | Number of bytes of article     |
|           9 | snippet            | Beginning of article snippet   |
|          10 | user_name          | User name                      |
|          11 | user_editcount     | User total edit                |
|          12 | user_creation_date | User registration date         |
|          13 | user_autoconfirmed | Check if user is autoconfirmed |
|          14 | user_bot           | Check if user is in bot group  |
|          15 | user_block_status  | User block status              |
|          16 | user_id            | User id                        |
+-------------+--------------------+--------------------------------+
16 rows in set (0.00 sec)
Comment 5 bsitu 2012-09-19 17:59:55 UTC
Looks like ArticleMetadata::getValidTags() is returning empty array() from ApiBlockTest.

I fixed the outdated unit test in pagetriage: https://gerrit.wikimedia.org/r/#/c/24309/ and ArticleMetadataTest::testGetValidTags() passes the test.

I am not sure how to 'fix' it so it will pass ApiBlockTest

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


Navigation
Links