New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slightly improve handling of Scribunto/non-wikitext content models #857
Slightly improve handling of Scribunto/non-wikitext content models #857
Conversation
a0e6c15
to
fecc728
Compare
Another way of doing the first commit would be to rely on |
…pNonRedirectCreator is provided PR wikimedia-gadgets#710 added the ability for `fnLookupCreationSuccess` to find the creator of the first non-redirect revision via `fnLookupNonRedirectCreator` (see also wikimedia-gadgets#805) by adding `content` to the `rvprop`s list as well as `rvsection=0`. That doesn't work for non-wikitext content models, who will returned a `rvnosuchsection` error in such cases. Removing `content` would solve the error, as would `rvsection=0`, but the actual redirect check (`/^\s*#redirect/i`) doesn't make sense in those scenarios (e.g. Scribunto, JS, CSS), so there's no really point in even checking. Instead, only attempt to use `content` and `rvsection` if `lookupNonRedirectCreator` is set. Currently, only AfD and PROD do so, which aligns with how it should be limited. We could probably just use `wgPageContentModel`, but in theory the ability to query pages other than the current one, even if the two have different content models, seems useful. In practice, only `twinklexfd` attempts sch a thing, only for TfD merge nominations (`involvedpages`), and assumes that the target is in the same namespace as the current page, so Scribunto will match with Scribunto.
Uses params.scribunto to check if we're dealing with a /doc subpage or not (easier and more portable than regex testing, etc.), and simply call the `watch` api. Closes wikimedia-gadgets#572. Also removes some collateral with undesired `pageobj.setCreateOption('recreate')` for non-module taggings.
fecc728
to
133d227
Compare
Now works as I mentioned in #857 (comment) |
…placements Better and more complete way of doing 133d227 (wikimedia-gadgets#857), for both CfD and TfD, as well as some tidying for CfD/S. Only replaces the current namepsace, which is basically what was being done anyway, but this way it's obvious when we're pigeonholing a page into an incorrect namespace. For CfD/S, the behavior is basically inverted: instead of removing the namespace then adding it for just the discussion page, this removes it just for the tagging.
…placements Better and more complete way of doing 133d227 (wikimedia-gadgets#857), for both CfD and TfD, as well as some tidying for CfD/S. Only replaces the current namepsace, which is basically what was being done anyway, but this way it's obvious when we're pigeonholing a page into an incorrect namespace. For CfD/S, the behavior is basically inverted: instead of removing the namespace then adding it for just the discussion page, this removes it just for the tagging.
…placements Better and more complete way of doing 133d227 (wikimedia-gadgets#857), for both CfD and TfD, as well as some tidying for CfD/S. Only replaces the current namepsace, which is basically what was being done anyway, but this way it's obvious when we're pigeonholing a page into an incorrect namespace. For CfD/S, the behavior is basically inverted: instead of removing the namespace then adding it for just the discussion page, this removes it just for the tagging.
…placements Better and more complete way of doing 133d227 (wikimedia-gadgets#857), for both CfD and TfD, as well as some tidying for CfD/S. Only replaces the current namepsace, which is basically what was being done anyway, but this way it's obvious when we're pigeonholing a page into an incorrect namespace. For CfD/S, the behavior is basically inverted: instead of removing the namespace then adding it for just the discussion page, this removes it just for the tagging.
…placements Better and more complete way of doing 133d227 (wikimedia-gadgets#857), for both CfD and TfD, as well as some tidying for CfD/S. Only replaces the current namepsace, which is basically what was being done anyway, but this way it's obvious when we're pigeonholing a page into an incorrect namespace. For CfD/S, the behavior is basically inverted: instead of removing the namespace then adding it for just the discussion page, this removes it just for the tagging.
1st commit: morebits: lookupCreation won't query content and section unless lookupNonRedirectCreator is provided
PR #710 added the ability for
fnLookupCreationSuccess
to find the creator of the first non-redirect revision viafnLookupNonRedirectCreator
(see also #805) by addingcontent
to thervprop
s list as well asrvsection=0
. That doesn't work for non-wikitext content models, who will returned arvnosuchsection
error in such cases. Removingcontent
would solve the error, as wouldrvsection=0
, but the actual redirect check (/^\s*#redirect/i
) doesn't make sense in those scenarios (e.g. Scribunto, JS, CSS), so there's no really point in even checking.Instead, only attempt to use
content
andrvsection
iflookupNonRedirectCreator
is set. Currently, only AfD and PROD do so, which aligns with how it should be limited.We could probably just use
wgPageContentModel
, but in theory the ability to query pages other than the current one, even if the two have different content models, seems useful. In practice, onlytwinklexfd
attempts sch a thing, only for TfD merge nominations (involvedpages
), and assumes that the target is in the same namespace as the current page, so Scribunto will match with Scribunto.2nd commit: xfd/speedy: Watch tagged modules
Uses params.scribunto to check if we're dealing with a /doc subpage or not (easier and more portable than regex testing, etc.), and simply call the
watch
api. Also removes some collateral with undesiredpageobj.setCreateOption('recreate')
for non-module taggings. Closes #572; Sorry if you were actively looking at this @DannyS712 and I scooped you, I got thinking after the above.3rd commit: xfd: Fix tfm preview when namespace is included