Page MenuHomePhabricator

LQT API throws fatal error if talkpage parameter missing
Closed, ResolvedPublic

Description

Visit api.php?action=threadaction&method=talkpage_new_thread&threadaction=inlineeditform&token=%2B%5C&format=json (requires POST, I think, so to test this type $.post('/w/api.php?.....'); in the Firebug console) and you'll get ta fatal error. This request normally has a &talkpage= parameter, and when it's present everything works just fine.

These requests are sometimes generated when clicking the New section tab on a talk page (could only reproduce when logged out on prototype.wikimedia.org/d-en (runs REL1_17), not when logged in and not on trunk), and the JS involved seems to have no mechanism to either check it's sending correctly formed request or to handle errors.

Fatal error: Call to a member function getTitle() on a non-object in /home/catrope/mediawiki/trunk/extensions/LiquidThreads/classes/Thread.php on line 1550

Call Stack:

0.0035     362648   1. {main}() /home/catrope/mediawiki/trunk/phase3/api.php:0
0.2714   10875524   2. ApiMain->execute() /home/catrope/mediawiki/trunk/phase3/api.php:116
0.2714   10875568   3. ApiMain->executeActionWithErrorHandling() /home/catrope/mediawiki/trunk/phase3/includes/api/ApiMain.php:328
0.2715   10916956   4. ApiMain->executeAction() /home/catrope/mediawiki/trunk/phase3/includes/api/ApiMain.php:344
0.2834   11547668   5. ApiThreadAction->execute() /home/catrope/mediawiki/trunk/phase3/includes/api/ApiMain.php:662
0.2834   11550824   6. call_user_func_array() /home/catrope/mediawiki/trunk/extensions/LiquidThreads/api/ApiThreadAction.php:49
0.2834   11550856   7. ApiThreadAction->actionInlineEditForm() /home/catrope/mediawiki/trunk/extensions/LiquidThreads/api/ApiThreadAction.php:0
0.2905   12227016   8. LqtView::getInlineEditForm() /home/catrope/mediawiki/trunk/extensions/LiquidThreads/api/ApiThreadAction.php:785
0.3016   12919532   9. LqtView->doInlineEditForm() /home/catrope/mediawiki/trunk/extensions/LiquidThreads/classes/View.php:378
0.3138   13774728  10. LqtView->showNewThreadForm() /home/catrope/mediawiki/trunk/extensions/LiquidThreads/classes/View.php:342
0.3139   13774872  11. Thread::canUserPost() /home/catrope/mediawiki/trunk/extensions/LiquidThreads/classes/View.php:388

Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=29211

Details

Reference
bz26698

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 11:20 PM
bzimport set Reference to bz26698.
bzimport added a subscriber: Unknown Object (MLST).
Catrope created this task.Jan 12 2011, 10:14 PM

Wonder if this is still an issue

I see it has

		// Validate talkpage parameters
		if ( empty( $params['talkpage'] ) ) {
			$this->dieUsageMsg( array( 'missingparam', 'talkpage' ) );
		}

Which I swapped for !count() in r84377

Jorm removed a subscriber: Jorm.Dec 26 2015, 7:28 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 26 2015, 7:28 PM
Nikerabbit closed this task as Resolved.Mar 29 2016, 12:27 PM
Nikerabbit claimed this task.
Nikerabbit added a subscriber: Nikerabbit.

Tested the command in the summary: no error.