This reverts commit dab7b16741.
Reason for revert: This was inaccurate/incomplete &
looks like we will not need this after all
Bug: T286362
Change-Id: I6d63d69f180d193f99986ce6878617d63cfb2b6d
When fetching a key from an array, PHP converts numeric strings to
integers. This led to an incorrect category update query.
So:
* In LinksTable subclasses, cast all string-like array keys to string.
* Add a unit test which confirms that no integers leak into link IDs.
* Add a fully integrated regression test for T301433.
The integration test and 7 of the link ID cases are confirmed to fail
if Amir's patch is reverted.
Bug: T301433
Change-Id: I8d19443607121b3efcafb82096bcff18c41035df
Add a hook which runs at the end of UserEditCountUpdate. The idea is to
allow CentralAuth to keep its own similar edit count. There's no
other hook appropriate for this purpose since
UserEditTracker::incrementUserEditCount() has multiple callers.
Convert the private associative array in UserEditCountUpdate to a class.
Instances of the class are passed to the new hook. A class is better
suited to a public interface.
Bug: T300075
Change-Id: I16a92e6a6e9faf1be4c7fbe25354a08559df163d
* In PagePropsTable, compare values after converting to string. In the
old code this was implicitly done by array_diff_assoc().
* Also convert to string before inserting, since
ParserOutput::setPageProperty() is documented as allowing null, but
the field is not nullable, so the query failed.
* Add a regression test which confirms that no write queries are done on
the second invocation of LinksUpdate.
Bug: T299662
Change-Id: I3f7d5800bf27a47cb57be80bdba13792fe3caae6
This access to mImages was unintentionally left in after the property
was deprecated.
Bug: T299472
Change-Id: Icd7f8db4d100ddc0ce30399be1f8d5e625523730
Running cat_pages + 1 and cat_pages - 1 for the same rows/categories is
uneeded.
Cannot skip the whole update on move, because by use of parser functions
there could be new categories after cross namespace page moves.
Follow-Up: Ifaa4051a736b01cda82fbd890325e0751ce041f8
Change-Id: I188d0224f1a1d43746f657159e0ed8c80b8646cd
The page identity given the parent LinksUpdate is a mutable Title object
and the page id is refreshed after the real deletion of the page table.
When LinksUpdate is running after that is using 0 to select from link
tables and to refresh category counters.
Bug: T299244
Change-Id: I9c1da630211ad678a4e12acf437d356e1c088d7f
Add $wgTempCategoryCollations which tells LinksUpdate to write to
additional tables similar to categorylinks, except that the additional
tables have a custom collation.
This is supposed to be used with RemoteIcuCollation to ease migration to
a different version of ICU.
Bug: T263437
Change-Id: Id340d2213cc22115eda5d26f010b5287bd3796cf
Since LinksUpdate was already run after a page move, it was just a
matter of propagating a move flag down to it, and resolving the
differences between the move case and the edit case.
This should be faster since it avoids writing to the links tables twice
on a page move.
Change-Id: Ifaa4051a736b01cda82fbd890325e0751ce041f8
* In LinksUpdate, put each table in its own class, so that the
special code for each table has a more elegant place to go.
* Use generators to abstract and flatten out the underlying ParserOutput
data structures, without requiring the data to be copied. This allows
the incremental logic which was previously duplicated for each table,
i.e. computing insertions and deletions from the old and new state,
to be factored out. The per-table batch classes act as container
abstractions for the underlying data.
Bug: T263437
Depends-On: I472f4a023969bfde6298eb56112c16d2ae842199
Change-Id: Id40be19a8caa7b4669911927964cfd6755c25238
Each table at least needs an added, deleted and unmodified link in order
to fully exercise the incremental update code.
Disable INSERT IGNORE during testing, since this can hide an omitted
delete query.
Change-Id: Iaa9f32ea5171da4f983379d7ff313bfdf1cb0b2f
As an alternative to public property access. In LinksUpdateComplete,
$this->mId will always be set and will be more reliable than the Title
property.
Change-Id: Id046cff59c5c1fbc9a6a7fd196c4446e1234278f
The ::getProperty() naming is too generic and doesn't clearly indicate
that these are "page properties" (which have their own table in the DB).
As part of refactoring a clean API out of ParserOutput which can be used
by Parsoid, clean up the naming here.
Soft-deprecation in this patch, there are a handful of external users
which need to be cleaned up before we hard-deprecate.
Bug: T287216
Change-Id: Ie963eea5aa0f0e984ced7c4dfa0fd65d57313cfa
This does a breaking change, but all (2) known usages
of the LinksUpdate::getTriggeringUser are satisfied
by UserIdentity.
Change-Id: I682ee65f7b3d30fe6c0fe76d5106857ddfa6da5d
Use ObjectFactory specs for collation classes
Avoid the language construction in the factory class,
make it a detail of the implementation of each class
Follow-Up of Ifc96f851e6091ce834dbaf0e91695c648a42169c
Bug: T286079
Change-Id: Ib581f64aec8619986fb8dd49ceee0524d59a1b84