Page MenuHomePhabricator

"php deleteOldRevisions.php --delete" doesn´t work anymore
Closed, ResolvedPublic

Description

I get:

Strict Standards: Creating default object from empty value in /var/www/kiwix/mirroring_tools/data/conf/default.php on line 88
Delete old revisions

Must pass at least 1 page_id

... seems not be possible anymore to remove *all* old revisions like indicated here:
http://marc.info/?l=mediawiki-l&m=116570740928550&w=2

The test on line 36 is responsible for that.

I suggest to remove it, at lest if the "--delete" arg is there.


Version: 1.16.x
Severity: enhancement

Details

Reference
bz20612

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport set Reference to bz20612.

(In reply to comment #0)

I get:

Strict Standards: Creating default object from empty value in
/var/www/kiwix/mirroring_tools/data/conf/default.php on line 88
Delete old revisions

I'm not sure what that file is, but it's not Mediawiki

Must pass at least 1 page_id

... seems not be possible anymore to remove *all* old revisions like indicated
here:
http://marc.info/?l=mediawiki-l&m=116570740928550&w=2

The test on line 36 is responsible for that.

I suggest to remove it, at lest if the "--delete" arg is there.

True, I noticed that when I was refactoring the script. Maybe an --all parameter would work.

$ php ./deleteOldRevisions.php --all
Delete old revisions

Must pass at least 1 page_id
$

... same result.

Well of course it won't work, it hasn't been written yet. I was saying that an --all parameter would be helpful.

OK, I will do it... but IMO this is not really good to change the usage().

Created attachment 6551
Patch with --all option and a rewriting to allow to the script to be successful with big DB

Attached:

Please take a look to my patch: it introduces the "--all" option.

But there is also a main rewriting of the script because with big databases,
the set of ids is too big to be accepted by the server and the script dies.

Now it works until the script calls purgeRedundantText() in Maintenance.php. At
this time the script dies for the same reason as deleteOldRevisions.php before
(too much ids) like following:

Il database ha restituito il seguente errore "1153: Got a packet bigger than
'max_allowed_packet' bytes (localhost)".

... but I prefer to propose a patch in an other bug report if you confirm the
issue.

Fixed in r57540. Restored old behavior broken from maintenance-work branch merge. No page ids falls back to operating on all pages, as before.