Network icon indicating copy to clipboard operation
Network copied to clipboard

Cannot enable namespaces listed in extension.json as excluded

Open cicalese opened this issue 4 years ago • 6 comments

extension.json includes:

"PageNetworkExcludedNamespaces": { "value": [ 2, 4, 8, 12 ] },

However, arrays defined in extension.json can only be added to (there isn't much documentation for this, but you can see https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#Merge_strategies). So, it is not possible to remove those four default namespaces from the exclude list. It would be better to set that to an empty array and allow site admins to add namespaces as needed.

cicalese avatar May 09 '21 22:05 cicalese

Uhh, two downsides to that specific change:

  • breaking change, needs major release
  • less good default values, requiring more work on extension installation

Can probably work around that with some more effort

JeroenDeDauw avatar May 10 '21 11:05 JeroenDeDauw

Good news! I discovered that a patch was created recently to fix this problem, which was also affecting another extension: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/684668. I tested and merged it, so it will be available in MW 1.37. At that point, the extension.json will need to be updated to use the provide_default merge strategy.

cicalese avatar May 13 '21 23:05 cicalese

The patch mentioned above was backported to the MediaWiki 1.35 and 1.36 branches, so it will be available in the 1.36 release as well as the next 1.35 point release. Once those releases are made, the "provides_default" merge strategy could be specified in extension.json, but that would break compatibility with earlier point releases of 1.35 and anything earlier.

cicalese avatar May 27 '21 19:05 cicalese

Would this be solved in a 2.0 release? https://github.com/ProfessionalWiki/Network/pull/51

krabina avatar Jul 08 '21 09:07 krabina

Not unless we bump the version requirement to MW 1.35.3+. The fix is not in earlier releases in the MW 1.35 branch. What are thoughts on that requirement?

cicalese avatar Jul 10 '21 19:07 cicalese

As long as 1.35 is supported, I am fine with this. 1.35.3 ist the latest LTS release, so for security reasons, everbody should upgrade

krabina avatar Jul 10 '21 20:07 krabina