Page MenuHomePhabricator

Fix NotWikiLambda since we landed the 'get rid of the ZObject: namespace' patch
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • go to Special:CreateZObject
  • Enter everything for a function, click save

What happens?:
{ "type": "error", "text": "⧼ZObject record type 'Z8' not recognised.⧽" }

What should have happened instead?:
Created a function

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

Event Timeline

This could be related to us landing the patch to use the main namespace instead of a special namespace. CC @Jdforrester-WMF

Jdforrester-WMF renamed this task from Can't create functions on Notwikilambda to Fix NotWikiLambda since we landed the 'get rid of the ZObject: namespace' patch.Aug 25 2021, 4:43 PM
tools.notwikilambda@interactive:~$ head -n10 zobjects | php public_html/w/maintenance/moveBatch.php --r '[[phabricator:T289682|T289682]]' --u 'Lucas Werkmeister' 
ZObject:Z1 --> Z1
FAILED: Cannot move pages into namespace "(Main)".

blegh. I’ll see where WikiLambda forbids this and see if I can temporarily hack it out

Mentioned in SAL (#wikimedia-cloud) [2021-08-25T18:55:19Z] <wm-bot> <lucaswerkmeister> kubectl delete deployment update # temporarily disable automatic updates since I’ll probably have to hand-edit the code for T289682

wasn’t too hard to find ^^ let’s see if this works

diff --git a/extension.json b/extension.json
index bb91859..d0ca53b 100644
--- a/extension.json
+++ b/extension.json
@@ -75,7 +75,6 @@
                "getUserPermissionsErrors": "WikiLambdaHooks",
                "MultiContentSave": "WikiLambdaHooks",
                "LoadExtensionSchemaUpdates": "WikiLambdaHooks",
-               "NamespaceIsMovable": "WikiLambdaHooks",
                "CodeEditorGetPageLanguage": "MediaWiki\\Extension\\WikiLambda\\Hooks::onCodeEditorGetPageLanguage"
        },
        "MessagesDirs": {

Aha, the broken ZObject strikes again.

tools.notwikilambda@interactive:~$ head -n10 zobjects | php public_html/w/maintenance/moveBatch.php --r '[[phabricator:T289682|T289682]]' --u 'Lucas Werkmeister' 
ZObject:Z1 --> Z1
ZObject:Z10 --> Z10
ZObject:Z100 --> Z100[d10a53a084a366c9f74d2ab2] [no req]   Error: Call to a member function getLabels() on null
Backtrace:
from /data/project/notwikilambda/public_html/w/extensions/WikiLambda/includes/ZObjectContent.php(389)
#0 /data/project/notwikilambda/public_html/w/includes/content/AbstractContent.php(548): MediaWiki\Extension\WikiLambda\ZObjectContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#1 /data/project/notwikilambda/public_html/w/includes/Revision/RenderedRevision.php(263): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#2 /data/project/notwikilambda/public_html/w/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(MediaWiki\Extension\WikiLambda\ZObjectContent, boolean)
#3 /data/project/notwikilambda/public_html/w/includes/Revision/RevisionRenderer.php(217): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#4 /data/project/notwikilambda/public_html/w/includes/Revision/RevisionRenderer.php(154): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#5 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#6 /data/project/notwikilambda/public_html/w/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#7 /data/project/notwikilambda/public_html/w/includes/Storage/DerivedPageDataUpdater.php(1389): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#8 /data/project/notwikilambda/public_html/w/includes/Storage/DerivedPageDataUpdater.php(1766): MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#9 /data/project/notwikilambda/public_html/w/includes/Storage/DerivedPageDataUpdater.php(1665): MediaWiki\Storage\DerivedPageDataUpdater->doParserCacheUpdate()
#10 /data/project/notwikilambda/public_html/w/includes/Storage/DerivedPageDataUpdater.php(1515): MediaWiki\Storage\DerivedPageDataUpdater->triggerParserCacheUpdate()
#11 /data/project/notwikilambda/public_html/w/includes/page/WikiPage.php(2178): MediaWiki\Storage\DerivedPageDataUpdater->doUpdates()
#12 /data/project/notwikilambda/public_html/w/includes/MovePage.php(1014): WikiPage->doEditUpdates(MediaWiki\Revision\RevisionStoreRecord, User, array)
#13 /data/project/notwikilambda/public_html/w/includes/MovePage.php(670): MovePage->moveToInternal(User, Title, string, boolean, array)
#14 /data/project/notwikilambda/public_html/w/includes/MovePage.php(483): MovePage->moveUnsafe(User, string, boolean, array)
#15 /data/project/notwikilambda/public_html/w/maintenance/moveBatch.php(104): MovePage->move(User, string, boolean)
#16 /data/project/notwikilambda/public_html/w/maintenance/doMaintenance.php(108): MoveBatch->execute()
#17 /data/project/notwikilambda/public_html/w/maintenance/moveBatch.php(119): require_once(string)
#18 {main}

(This is a known-broken page from T284368.) It looks like Z1 and Z10 were successfully moved (albeit without leaving a redirect behind), so I think I’ll just run this in small batches and hand-edit the zobjects list file to exclude the broken ones. That seems like the simplest solution to me.

Okay, so I’m not sure why Z1 worked, but after that practically all other objects seem to fail. Not sure why, maybe the move of Z1 made things worse for them.

But! That stack trace comes from trying to generate parser output post-save, and it just so happens that @Ladsgroup made this configurable literally today (T285987) –

diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php
index dcd5f95006..2f8b8b7c13 100644
--- a/includes/content/ContentHandler.php
+++ b/includes/content/ContentHandler.php
@@ -1274,7 +1274,7 @@ abstract class ContentHandler {
         * @return bool true if edit should trigger an HTML render false otherwise
         */
        public function generateHTMLOnEdit(): bool {
-               return true;
+               return false;
        }
 
        /**

– and with that patch, the import seems to work much better.

tools.notwikilambda@interactive:~$ tail zobjects | php public_html/w/maintenance/moveBatch.php --r '[[phabricator:T289682|T289682]]' --u 'Lucas Werkmeister'
ZObject:Z921 --> Z921
ZObject:Z922 --> Z922
ZObject:Z944 --> Z944
ZObject:Z966 --> Z966
ZObject:Z968 --> Z968
ZObject:Z986 --> Z986
ZObject:Z988 --> Z988
ZObject:Z99 --> Z99
ZObject:Z999 --> Z999
ZObject:Z99953 --> Z99953

lol

Mentioned in SAL (#wikimedia-cloud) [2021-08-25T19:18:18Z] <wm-bot> <lucaswerkmeister> moved all ZObject pages to main namespace using moveBatch.php (T289682)

Even Z100 moved successfully now. It still crashes if you try to view it, but hey, it’s moved ^^

(And I don’t know why the maintenance script insisted on not creating redirects, I didn’t specify --noredirects.)

LucasWerkmeister claimed this task.

Looks like creating a function works again: https://notwikilambda.toolforge.org/wiki/Z10058

(I don’t remember how to define testers from the demo video so for now it only has an implementation.)

Mentioned in SAL (#wikimedia-cloud) [2021-08-25T19:24:07Z] <wm-bot> <lucaswerkmeister> kubectl create -f k8s/update/deployment.yaml # restart automatic updates (T289682)

Ha. Thanks for your work!

Did you force editability off? I'm getting cantcreate-anon when trying to edit (whilst logged in).

I don’t think so – make sure you’re still logged in (reload the page), sessions are short-lived for some reason I haven’t figured out.

Mentioned in SAL (#wikimedia-cloud) [2021-08-25T20:43:53Z] <wm-bot> <lucaswerkmeister> removed namespace protection from main namespace, now that move of ZObjects to main namespace is completed (T289682)

Sorry, my bad – I had namespace-protected the main namespace, just not today (which is why I didn’t think of it right away).

Sorry, my bad – I had namespace-protected the main namespace, just not today (which is why I didn’t think of it right away).

Aha. Thank you!

Mentioned in SAL (#wikimedia-cloud) [2021-08-25T21:05:34Z] <wm-bot> <lucaswerkmeister> namespace-protect ZObject and ZObject talk namespaces so nobody (not even sysops) can edit them – there should be no reason to use that namespace after T289682 and I assume WikiLambda will soon stop defining it