Page MenuHomePhabricator

Flow: clicking Undo of a moderation action after you're logged out silently fails with fatal error
Closed, ResolvedPublic

Description

While filing bug 72993 I let the "Scenario: Deleting a topic" delete the top-most topic with KEEP_BROWSER_OPEN=true. I returned to this browser window an hour or more later and clicked the Undo button in the
[This topic has been deleted. _Undo_]
flow-moderated-topic-title.

Nothing happened. I retried with the developer console Net tab open, and the POST request returned status 200 and 20 empty bytes. According to cURL it's responding with 1f 8b 08 00 00 00 00 00 00 03 03 00 00 00 00 00 00 00 00 00

I think what happened is the Selenium user had been logged out due to session timeout (the QA tests do not check [ ] Keep me logged in when logging in), and then the attempt to report the failure blows up. ee-flow's Apache log has *two* errors for the one request (below)

  1. Undefined property: Flow\\Block\\TopicBlock::$user in getDisallowedErrorMessage()
  2. $this->user->isAllowed() call in getDisallowedErrorMessage() when there's no user in /srv/mediawiki/extensions/Flow/includes/Block/Topic.php

both stemming from the user being logged out. I don't even see a $user member variable. Line 754 arose from mlitn's "Show more descriptive error message for insufficient permissions"

When an anonymous or logged-out user tries to view this deleted topic http://ee-flow.wmflabs.org/wiki/Topic:S5i6a0emy49f9668 , they see a blank HTML page and the log has a similar error. I'll file that separately.

Here are the two errors logged when I repeated the undo POST request with curl, basically 'action=flow&format=json&submodule=moderate-topic&page=Topic%3AS5i6a0emy49f9668&mtreason=%3Cflow-topic-undo-delete%3E&mtmoderationState=undelete&token=%2B%5C' Note the wrong-looking token.

All lines start with "[Wed Nov 05 04:41:39 2014] [error] [client 10.68.16.65] PHP" and end with ", referer: http://ee-flow.wmflabs.org/wiki/DUMMYCURL"

Notice: Undefined property: Flow\\Block\\TopicBlock::$user in /srv/mediawiki/extensions/Flow/includes/Block/Topic.php on line 754
Stack trace:

    1. {main}() /srv/mediawiki/api.php:0
    2. ApiMain->execute() /srv/mediawiki/api.php:85
    3. ApiMain->executeActionWithErrorHandling() /srv/mediawiki/includes/api/ApiMain.php:362
    4. ApiMain->executeAction() /srv/mediawiki/includes/api/ApiMain.php:391
    5. ApiFlow->execute() /srv/mediawiki/includes/api/ApiMain.php:952
    6. ApiFlowBasePost->execute() /srv/mediawiki/extensions/Flow/includes/api/ApiFlow.php:81
    7. Flow\\WorkflowLoader->handleSubmit() /srv/mediawiki/extensions/Flow/includes/api/ApiFlowBasePost.php:19
    8. Flow\\SubmissionHandler->handleSubmit() /srv/mediawiki/extensions/Flow/includes/WorkflowLoader.php:63
    9. Flow\\Block\\AbstractBlock->onSubmit() /srv/mediawiki/extensions/Flow/includes/SubmissionHandler.php:104
  1. Flow\\Block\\TopicBlock->validate() /srv/mediawiki/extensions/Flow/includes/Block/Block.php:194
  2. Flow\\Block\\TopicBlock->loadTopicTitle() /srv/mediawiki/extensions/Flow/includes/Block/Topic.php:103
  3. Flow\\Block\\TopicBlock->getDisallowedErrorMessage() /srv/mediawiki/extensions/Flow/includes/Block/Topic.php:733

and immediately afterwards
Fatal error: Call to a member function isAllowed() on a non-object in /srv/mediawiki/extensions/Flow/includes/Block/Topic.php on line 754
Stack trace:

(identical)

Version: master
Severity: normal

Details

Reference
bz73003

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:48 AM
bzimport set Reference to bz73003.

I think this is an amalgamation of two other bugs:
bug 73004 Flow: blank page/503 output viewing a deleted topic if you don't have rights
bug 73007 Flow: API errors in Undo moderation aren't reported to the user

Firefox was acting weird, it's been a long night :)

Indeed, it's a combination of those 2 other bugs, so I'll close this one

  • This bug has been marked as a duplicate of bug 73004 ***