Page MenuHomePhabricator

LQT 2.0 - Cannot read property 'token' of undefined
Closed, ResolvedPublic

Description

Author: Volodya

Description:
Hello,

After upgrading MediaWiki i have began to encounter the following error when creating or replying to a thread on LQT 2.0 with javascript enabled:

Uncaught TypeError: Cannot read property 'token' of undefined

It happens on at the following execution.

var token = data.threadaction.token;

I've looked at what 'data' is, and it's:
data -> Object
error -> Object
code = "notoken"
info = "The token parameter must be set"
...
There are some __proto things there too, let me know if you need them

Server:

MediaWiki 1.21.2

Client:

Chromium	28.0.1500.71 (Developer Build 28.0.1500.71-0ubuntu1.12.04.1)
Ubuntu 12.04

Version: REL1_21-branch
Severity: major
OS: Linux
URL: https://www.mediawiki.org/wiki/Extension_talk:LiquidThreads#Cannot_read_property_.27token.27_of_undefined_34400

Details

Reference
bz55694

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:33 AM
bzimport set Reference to bz55694.
bzimport added a subscriber: Unknown Object (MLST).

Is there a public wiki URL where this can be tested/seen?

Volodya wrote:

No, i've now purposefully broken Javascript in LQT. I'll think of how i can make it visible to help resolve this but, but yet not break the site in the process.

I can consistently reproduce this bug downloading latest 1.21 version (1.21.3) and latest LQT matching 1.21 version (1e65894) from mediawiki.org

When creating a new thread, it sends a POST to api.php with those parameters:

action=threadaction&gettoken=gettoken&format=json

And the response is:

{"error":{"code":"notoken","info":"The token parameter must be set"}}

The issue solves for me when retrieving LQT version at commit cf2ba86af92fc63f9e5f272cbe06b828bbb2072f, which is the merge of gerrit change 58817, follow up of gerrit change 50857

Someone needs to backport these into 1.21 release branch, or forward 1.21 branch until that commit.

I haven't tested all LQT features at this point, so I'm not sure if anything else is badly broken. Although it *requires* Extension:WikiEditor to be installed, otherwise JavaScript throws an error about unknown ext.wikieditor module.

[Setting backport flag to ? as per comment 4]

Krenair: Any plans to backport this to REL_1_21?

Cherry picking doesn't work. It seems clear that this isn't urgently needed.

Jdforrester-WMF lowered the priority of this task from High to Lowest.Aug 4 2016, 11:33 PM
Jdforrester-WMF subscribed.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.

This was fixed in the master branch of LQT and released through REL1_22. Closing this task as 1.21 is no longer supported.