Commit graph

8 commits

Author SHA1 Message Date
Subramanya Sastry
5fc7e1974c For Internal REST API users, make revid handling lenient
* Parsoid REST API which considers both title and revid will soon
  be made internal. The core REST API only has endpoints where either
  the title OR the revid is provided and is not subject to this issue.

* This patch ignores page id mismatches and simply uses the revision
  page id where the mismatch is detected. This is only supported for
  ParsoidHandler which sets the lenient revision handling while fetching
  the HtmlOutputRendererHelper.

  For these API requests, the output is not cached.

* Local testing shows that this fixes the issue.

* Added new phpunit tests to ParsoidHandlerTest to verify expectations.
  Also verified that disabling this fix fails that test.

Bug: T349235
Change-Id: I2f4a4a644710ee1e3894e6dc6a066eb37846bdfd
2023-10-23 09:31:38 -05:00
Isabelle Hurbain-Palatin
33908cebed Revert "Revert "Remove unused class_alias deprecated in MW 1.40""
This reverts commit cbde6b69de to re-apply
the initial patch. This should only be merged once
I2acfd0b7a1e48aec107ded3bbe4963e2df24f4d3 is deployed.

Change-Id: If12ab65b1d773946fca6c8601ff51290136549c8
2023-09-29 13:08:50 +02:00
Isabelle Hurbain-Palatin
cbde6b69de Revert "Remove unused class_alias deprecated in MW 1.40"
This reverts commit ec22840c4a.

This patch currently creates issues on beta, which still runs with the
latest vendor version of Parsoid. If, for some reason, Parsoid doesn't
get deployed with this patch, I2acfd0b7a1e48aec107ded3bbe4963e2df24f4d3
doesn't get included, and the REST page handler breaks.

Staggered deploy seems safer in this context, hence the proposal for a
temporary revert, and a merge after the next Parsoid vendor patch is
deployed.

Change-Id: I3f859fa807a04892a67323cd4e98be0d3fbb1676
2023-09-29 11:21:49 +02:00
Fomafix
ec22840c4a Remove unused class_alias deprecated in MW 1.40
The Helper classes are deprecated since 1afd52e3e4.

Depends-On: I2acfd0b7a1e48aec107ded3bbe4963e2df24f4d3
Change-Id: Ie9973c6d6474bb7b4720c0641ca7492dc946d923
2023-09-28 18:47:13 +00:00
James D. Forrester
b16be7a36c Namespace TitleFormatter under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ic2d59eb6764b1a273ed7162ecabf641f638b8f66
2023-09-19 05:17:18 +00:00
daniel
942a286181
Support variant redirects in /page/html REST endpoint
This is a stepping stone patch to begin supporting redirecting
a non-existing page to it's corresponding language variant in our
REST end-points.

Bug: T338605
Change-Id: I3b28c9f99b4be19a90086362cb32bd87451c49e1
2023-09-13 22:07:50 +01:00
daniel
5bc235c966 Convert PageRedirectHandlerTrait to PageRedirectHelper
Using a helper object instead of a trait allows for dependency
injection through PageRestHelperFactory. This will make it easier to add
language variant redirects in the next step.

Change-Id: I1d4f26c380797e28e1b97051400bb9b1301b89ab
2023-06-20 21:15:24 +02:00
Derick Alangi
1afd52e3e4 REST: Move Helper classes to their own namespace
Mixing Handlers with Helpers doesn't look nice for consistency
reasons. Helpers should be in their own place (grouped) in the
Handlers directory as they're really "helpers for the handlers".

Change-Id: Ieeb7a0a706a4cb38778f312bfbfe781a1f366d14
2023-01-16 21:16:09 +01:00
Renamed from includes/Rest/Handler/PageRestHelperFactory.php (Browse further)