Page MenuHomePhabricator

"Title::newFromTitle: $text must be a string" from PrefixSearch
Closed, ResolvedPublicPRODUCTION ERROR


Looking in logstash for channel:T76305 to find these hits.

Warning: Title::newFromTitle: $text must be a string

Note that Title::newFromText already throws for objects and tolerates null. So this must be a primitive non-null, non-string value being passed somehow.

Event Timeline

Krinkle raised the priority of this task from to Medium.
Krinkle updated the task description. (Show Details)
Krinkle added subscribers: Krinkle, Reedy.

I wasn't able to reproduce this in plain MediaWiki. I suspect this is coming from a CirrusSearch hook, namely That call to substr looks very suspicious, I imagine it could easily return false if the right string is passed in.

I wonder if someone with Vagrant+CirrusSearch could have a play around with this?

This task is effectively a dupe of T109975 and should have been fixed by Seems like that got reverted in b7f078c75e75c57aa06c4f61f0427bd5ffcf219a for some reason.

got reverted in b7f078c75e75c57aa06c4f61f0427bd5ffcf219a for some reason.

From the commit message:

PrefixSearch: Follows-up 337b1e2e. null is already handled. If other types are passed, we want to find these.

Function documentation:

/*  @param string $search

The original patch was for fixing null, not false. Where is false coming from? That should be handled by the caller. This function doesn't support other types. Doing a type check in between this and Title::newFromText seems inappropriate.

I wonder if this is happening anymore, as the code was refactored so that normally PrefixSearch is not used unless searching for Special: etc. @Krinkle, could you check if it is still an issue? I've looked at and found no instances lately but I'm not sure if I did it right.

Deskana added a subscriber: Deskana.

Let's assume this one is resolved, then. @Krinkle or anyone else can reopen if we are mistaken, and we can continue investigations.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM