Page MenuHomePhabricator

Variable article_first_contributor always returns empty string in eswiki
Closed, InvalidPublic3 Estimated Story Points

Description

When trying to use the Abusefilter variable article_first_contributor in eswiki filters, I found that the only way for the condition to return true is: article_first_contributor == "". I don't know if the variable works in other wikis, if other variables are affected, or if it has worked before, since it was implemented ( T69793).

See AbuseFilterVariableHolder.php for the relevant code.

Acceptance criteria

  • The article_first_contributor AbuseFilter condition should function properly on all wikis with AbuseFilter enabled

Note: this may be a bug on all wikis; this ticket includes checking out whether the bug applies everywhere.

Event Timeline

kaldari set the point value for this task to 3.Jul 25 2017, 5:39 PM
dbarratt changed the task status from Open to Stalled.Aug 4 2017, 11:12 PM

@-jem-

I can't replicate this issue. Although I did notice that it is case sensitive.

Do you have some test usernames I can try? Can you verify this is still an issue?

@dbarratt: The issue is still there. No need for test usernames; I just use the "examine" interface for any abusefilter log entry, and from any test code that matches the change, if I add

& article_first_contributor == ""

the test remains positive, but with the correct or any other value inside the "", the test doesn't match. I've checked again a few minutes ago.

@-jem-

Can you provide a url to the log entry that failed?

@dbarratt I didn't get a fail. I wanted to include article_first_contributor in an existing filter (to let the article creator remove his/her text), and when I began doing tests with it, as explained, I found the problem, so I didn't move on, as it was obvious it wasn't going to work "in production".

@-jem-

Can you try something like this?

article_first_contributor == user_name

@dbarratt , I've tried and the results are as expected: user_name has always correct data, so, as it can't never be an empty string, when I test

article_first_contributor == user_name

the result is always false. And I've also discovered that, when I use the "Test a filter against previous edits" page, article_first_contributor does have always the correct value, but I'm using the "Examine individual changes" page from any log entry, and the value is always empty there (but other variables, including user_name, have the correct values).

@-jem-

It looks like the value is lazy loaded, which means it only gets it if it is being used. If it isn't in use when the filter is executed then it's an empty string (as far as I can tell).

@-jem-

Can you send me an example edit where article_first_contributor == user_name returns false where it should be true ?

@-jem- We're you able to find an example? I mean I can go into es wiki and add one, but I didn't want to mess anything up. :)

@dbarratt , as I said, I have done just tests, and I'm not aware of article_first_contributor being used in any filter, so I have no examples; but after your previous comment of the "lazy load", I think that maybe it works "in production" even if it doesn't in the tests (which should be fixed anyway, or documented, at least), so I want to add it to a filter and check its log afterwards, but I have been busy these days. It's no problem if you want to try it yourself :), I'll do it in a few days, I hope.

Daimona subscribed.

@-jem- I tried to replicate the issue, both on my local wiki and on it.wiki, but it doesn't appear: article_first_contributor is never empty. Since I don't have enough rights, could you please check if this still happens on es.wiki? IMHO there's nothing wrong with that variable, and the issue may actually be something else (e.g. T168736).

Now I got it. As dbarratt said above, the value is lazy loaded. This means that if no filter uses this variable (or, better, no filter computes it), it won't be saved for any action. So it's intended that if you examine a past log, generated when article_first_contributor wasn't used, the variable isn't populated. Instead, if you try it in batch testing it has a value (and you noticed it yourself) and it'll also have one for single logs if you add a filter that uses it.