Page MenuHomePhabricator

Merging pages via API sometimes broken
Closed, ResolvedPublic

Description

I am working on merging pages (categories) these days. Sometimes when I try to merge two pages via 'Edit links' from ptwiki, I get an error message: "$number needs to be integer". I don't know why.


Version: unspecified
Severity: normal
Whiteboard: u=dev c=backend p=0

Details

Reference
bz63278

Event Timeline

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

Do you have pages where this happened?

Few examples: Q9435762, Q9436054; more you can find in the contributions of Matěj Suchánek, offset 20143103000000 but I don't know how it can help you as the pages are already merged.

If you want examples of pages which haven't been merged yet, I can find them for you and you can test the merge.

Even though the offset is not necessary here, I wrote it wrong. It should be 20140331000000.

hawkeye7 wrote:

I can confirm this bug. I am trying to link [[en:Mareike Adermann]] with [[de:Mareike Adermann]]. I get an error: "An unexpected error occurred" and the details say "$number needs to be an integer"

Is the error exactly "$number needs to be an integer" ?
I don't seem to be able to find this anywhere in the entire codebase. :/

Reproduced:

The call is:
action=wbmergeitems&format=json&fromid=Q6758785&toid=Q1804120&ignoreconflicts=label%7Cdescription&origin=https%3A%2F%2Fen%2Ewikipedia%2Eorg&bot=1&token=eba222f0d9f056938338c3d64fc0b7ff%2B%5C

The error is:
{"servedby":"mw1192","error":{"code":"param-invalid","info":"$number needs to be a integer"}}

Odd how I cant find the error string anywhere in the code base but I will keep digging...

(In reply to Addshore from comment #6)

Odd how I cant find the error string anywhere in the code base but I will
keep digging...

With the power of grep (on master):

$ grep -ri 'needs to be a integer' .
./vendor/wikibase/data-model/src/Entity/PropertyId.php: throw new InvalidArgumentException( '$number needs to be a integer' );
./vendor/wikibase/data-model/src/Entity/ItemId.php: throw new InvalidArgumentException( '$number needs to be a integer' );

Hah, thanks hoo :P

Oddly when trying to run the same prams through the API sandbox it complains saying the APi Sandbox and wbmergeitems needs POST... I thought the sandbox did this? odd...

Change 123477 had a related patch set uploaded by Addshore:
Fix call to ItemId::newFromNumber with ID object

https://gerrit.wikimedia.org/r/123477

Change 123477 merged by Jeroen De Dauw:
Stop calling newFromNumber using an EntityId in ChangeOpsMerge

https://gerrit.wikimedia.org/r/123477

  • Bug 63567 has been marked as a duplicate of this bug. ***
  • Bug 63567 has been marked as a duplicate of this bug. ***