Commit graph

33 commits

Author SHA1 Message Date
Matěj Suchánek
dae38d6696 Preserve parameters during navigation on Special:PagesWithProp
There is a namespace filter and two more options on the page.
They weren't preserved when the user navigated to another batch
of results (e.g., using "50 next").

Change-Id: I702c08957daa204f151db0d85063da9818835866
2021-06-26 14:28:02 +02:00
Umherirrender
6ca2883ce8 Improve doc about object to be stdClass in QueryPage::formatResult
Change-Id: Ib1fadd74f2f3223ea8a9343d1524533f00b991df
2020-11-15 13:50:59 +01:00
Umherirrender
15442f328a Inject DBLoadBalancer into abstract QueryPage
Every QueryPage needs a database to work
Inject the new service on special pages with already using services.

Bug: T259960
Change-Id: I96d91993b70052484c1a6a918a1e2ccc91e39ae7
2020-11-02 00:41:32 +01:00
Umherirrender
2ca2cf6e86 Inject DBLoadBalancer into SpecialPagesWithProp
This covers only directly used services by this special page
Services used by the base class are not part of this patch set

Bug: T259960
Change-Id: I68e6fc3427e2b91e1b64ae27da2e382d814b7446
2020-10-17 00:43:34 +02:00
Thiemo Kreuz
64ef8f95a8 specials: HTMLForm::factory() method calls can be chained
Change-Id: I76a9179a0f03c23b28a7b59eb7b90aed5dfe1176
2020-09-08 16:20:44 +02:00
Reedy
8f48efcc35 Fix some includes/specials/ Squiz.Scope.MethodScope.Missing
Change-Id: I9c19e5ce8d789847d0f019372738a2eecb4c37a6
2020-05-18 21:21:17 +00:00
Bartosz Dziewoński
f557962456 SpecialPagesWithProp: Remove subpage from the URL when submitting
Previously, if you visited e.g. 'Special:PagesWithProp/aaa' and then
changed the value in the form to 'bbb' and submitted, you would end up
on 'Special:PagesWithProp/aaa?propname=bbb', which is confusing.

Change-Id: Icea0a8131c29f87f045618e155d6142c4b29f437
2020-04-01 18:42:12 +02:00
Matěj Suchánek
dd9328185f Fix namespace handling on Special:PagesWithProp
Firstly, restore the availability to query all namespaces.
There is no reason to remove this feature.

Secondly, fix code not to treat '0' as falsy. Instead, use
the request object to get an integer or null.

Bug: T50247
Change-Id: I182e25be2d694d010a1e8382a461c5c08f898581
2019-09-20 11:41:58 +02:00
DannyS712
f0b7ac18f5 Add namespace filter to Special:PagesWithProp
Bug: T50247
Change-Id: I887175add5e151cb4e195a15efeb334486297d22
2019-09-10 02:12:47 +00:00
Aaron Schulz
cb15755e92 Normalize use of "INNER JOIN" to "JOIN" in database queries
The ANSI SQL default join type is INNER and this might save
some line breaks here and there.

Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00
2019-03-06 09:17:30 -08:00
Timo Tijhof
15eac4c279 mediawiki.special: Combine various tiny specialpage style modules
These stylesheets are sufficiently tiny that it doesn't make sense to
offer them the ability to be loaded separately from each other (saving
bytes in double-digits) at the cost of 1) exporting a dedicated registry
item with meta data shipped on every page view, 2) reduced cache re-use
from increased fragmentation.

Instead, move these to the 'mediawiki.special' style module.
The entries retain their own files to keep them as easy to find
and edit as before.

Where not already, ensure addModuleStyles() is always placed above
any addModules() call in the same method. The load order isn't
affected by the call order, but given blocking style-modules load
before async JS, it helps to order them in a way that visually
matches the effective load order (from top to bottom).

The following 7 modules were remove without deprecation:

1. "mediawiki.special.apisandbox.styles" (1 rule)
2. "mediawiki.special.edittags.styles" (3 rules)
3. "mediawiki.special.movePage.styles" (1 rule)
4. "mediawiki.special.pagesWithProp" (1 rule)
5. "mediawiki.special.upload.styles" (2 rules)
6. "mediawiki.special.watchlist.styles" (3 rules)
7. "mediawiki.special.comparepages.styles" (4 rules)

These module names were only used on the core classes loading them, and
aren't depended on outside core by module name, rather, extensions and
gadgets depend on the styles styles being loaded in a blocking manner on
these pages, which remains unaffected.

Bug: T192623
Change-Id: I6e663dc3c80c7104c9b9abdde44c654543185373
2018-05-16 22:47:15 +00:00
Ricordisamoa
70557e3489 New parameters 'reverse' and 'sortbyvalue' for Special:PagesWithProp
Bug: T66950
Change-Id: Idc31289b1a9dd4746b2ecd502a23b182210384d8
2017-07-21 17:32:43 +04:00
Bryan Davis
aaf1e17088 Remove "@author Bryan Davis" and "Brad Jorsch" annotations
Undo traces of a practice we carried over from past projects and
existing examples that is neither universal nor actively encouraged in
the MediaWiki codebase.

Bug: T139301
Change-Id: I5c9c89b72a45a44aa4264a5e57b003c1a86cdf6e
Co-Authored-By: Brad Jorsch <bjorsch@wikimedia.org>
2017-06-26 15:25:46 -06:00
Subin Siby
ded8a172d9 Replaced Linker::link() usage with LinkRenderer in some special pages
Bug: T149346
Change-Id: I73c2b7402012a49e4419b6214f1d03f2e819220b
2016-12-04 06:09:00 +00:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Bartosz Dziewoński
8d8920501a SpecialPagesWithProp: Use 'combobox' field and convert to OOUI
Bug: T117730
Change-Id: I7d1d05cf7f96bd3b0bbc3650bf4ea4d411e46daf
2015-11-12 08:48:55 +00:00
Ricordisamoa
0e4f1ae4c8 SpecialPagesWithProp: convert implicit join into join_conds
Bug: T71083
Change-Id: Ic36ecd33a9b4b2ad8b3ca24fabbe496c5207b28f
2015-09-13 09:09:48 +00:00
Ricordisamoa
eec968e7a8 Add public keywords to QueryPage subclasses
Follows a5c9c9607e

Change-Id: I81b1d49e017792dea2c7eb0d98e99656576cf497
2015-08-20 15:02:54 +02:00
Chad Horohoe
b702cb3b24 Support offsets in prefix searching
Fixes T75522
Change-Id: I7a27a64e295a1efcb1d9728d95cf254bb8bfbe92
2014-12-02 11:59:26 -08:00
umherirrender
768ac15c70 Cleanup some docs (includes/[s-z])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: Ie419638e909a47aa72a274043604247830ee1a81
2014-07-24 19:43:44 +02:00
umherirrender
4bc8a7740b Add SpecialPagesWithProp::prefixSearchSubpages
This shows the existing props as subpages on search suggestion

Change-Id: I3d35474bcf840a6feede8079642d83074874c6f3
2014-06-30 21:17:11 +00:00
jenkins-bot
c38d687a3f Merge "Special:PagesWithProp: Distinguish content from interface" 2013-09-05 22:17:34 +00:00
MatmaRex
788a72dc88 Special:PagesWithProp: Use Language#formatSize
Followup to Ib2db241a.

Change-Id: I138ecaf20feac162a554591332e5c4d1e3234768
2013-08-17 15:24:48 +02:00
Alexandre Emsenhuber
9b61538e92 Special:PagesWithProp: Fix PHP notice if no page properties are present
Always declare $propnames as an array; do not assume that there will
be a property to implicitly set it.

Bug: 51891
Change-Id: I82c6b71a3283c7dc17e66873c2e54cea973c67c0
2013-07-26 10:32:03 +00:00
MatmaRex
c7635d00ba Special:PagesWithProp: Distinguish content from interface
Distinguish information about property values being hidden from the
actual values visually by making it italicised.

Added a new module, mediawiki.special.pagesWithProp.

Followup to Ib2db241a.

Bug: 51888
Change-Id: I6a0246e9b2a97b59503395ece7f80442ae3e0c69
2013-07-23 22:40:24 +02:00
MatmaRex
9a829641b5 Special:PagesWithProp: Do not show very long or binary values
It already looks rather silly when querying for 'templatedata' prop
from the TemplateData extension (e.g. [1]), it will start looking much
worse once Ie66b0dd6 in TemplateData is merged (which makes it store
the props gzip-compressed).

Do not show very long (over 1 kB) or binary (containing a null byte)
values; instead display a helpful message and size.

Changing the display format slightly, it's now "Page: <propvalue-or-message>"
instead of "Page (<propvalue-or-message>)", because the helpful
messages themselves include parentheses.

[1] https://en.wikipedia.org/wiki/Special:PagesWithProp?propname=templatedata

Bug: 51888
Change-Id: Ib2db241a117b06faee2426c8ea9ae18eab499e08
2013-07-23 18:26:28 +02:00
Siebrand Mazeland
a232f2c105 Update formatting
Also removed some commented out code and one or more unneeded elses.

Change-Id: I8a7f5c683e3aa570522fb31b027b695f195a3970
2013-05-18 13:06:27 +03:00
Siebrand Mazeland
b84a680a32 Update/add documentation
Change-Id: I897d5833cdaf7dc2d3bca5bb5551958611f22bd9
2013-04-14 21:18:38 +02:00
Alexandre Emsenhuber
2d1c31d347 Fixes to Special:PagesWithProp
- Remove unneeded call to HTMLForm::setAction()
- Call HTMLForm::setWrapperLegendMsg() instead of HTMLForm::setWrapperLegend()
- Use Html::element() instead of Xml::span()

Change-Id: I4bc90c223a89bd31ce2d93a959e9bdf4b546e6dd
2013-04-02 16:14:09 +02:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
umherirrender
96a5486ed0 Add SpecialPage::getGroupName and use it
Having all group mapping for Special:SpecialPages in the global
$wgSpecialPageGroups is not a good OO style.
Created a method SpecialPage::getGroupName, which than can be overridden
by each subclasses to the featured group name.

Added also SpecialPage::getFinalGroupName to get the groupname on
Special:SpecialPages to handle the customization and
to keep $wgSpecialPageGroups for b/c

Change-Id: I1de3a186f0a59ec5ecb8996c5f805cf164e9637f
2013-03-07 21:15:54 +01:00
Brad Jorsch
307ac55e50 Add PagesWithProp special page and API module
It would be useful to be able to list pages using a particular page
property, particularly in light of the new Disambiguator extension.

This adds a special page Special:PagesWithProp and an API query module
list=pageswithprop to do just this. It also adds an API query module
list=pagepropnames to list the prop names currently in use on the wiki.

Change-Id: Ib0d4e17f22b8d0cb9894eac6095962315480e809
2013-02-26 00:24:31 +00:00