enterprisemediawiki / meza

Setup an enterprise MediaWiki server with simple commands
MIT License
41 stars 27 forks source link

Pending 30.x with PHP 7 issues #985

Closed jamesmontalvo3 closed 6 years ago

jamesmontalvo3 commented 6 years ago

The following are issues on Meza 30.x with PHP7 as seen on a production-like server. These issues could be specific to PHP7 or could be Meza 30.x in general.

krisfield commented 6 years ago

For page forms multiple instance templates i see the following js errors in the dev console.

load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1t75s1g:52 Uncaught ReferenceError: mwTinyMCEInit is not defined at HTMLTextAreaElement.<anonymous> (<anonymous>:281:253) at Function.each (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1t75s1g:4) at jQuery.fn.init.each (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1t75s1g:2) at jQuery.fn.init.$.fn.initializeJSElements (<anonymous>:281:237) at HTMLDocument.<anonymous> (<anonymous>:282:248) at mightThrow (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1t75s1g:49) at process (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=1t75s1g:50)

djflux commented 6 years ago

Receiving the following with a fresh meza deploy monolith of 30.x-php7 branch:

Fatal error: Uncaught Error: Class 'WhoIsWatching\Article' not found in /opt/htdocs/mediawiki/extensions/WhoIsWatching/src/Hook.php:40 Stack trace: #0 /opt/htdocs/mediawiki/includes/Hooks.php(177): WhoIsWatching\Hook::onSkinTemplateOutputPageBeforeExec(Object(SkinVector), Object(VectorTemplate)) #1 /opt/htdocs/mediawiki/includes/Hooks.php(205): Hooks::callHook('SkinTemplateOut...', Array, Array, NULL) #2 /opt/htdocs/mediawiki/includes/skins/SkinTemplate.php(497): Hooks::run('SkinTemplateOut...', Array) #3 /opt/htdocs/mediawiki/includes/skins/SkinTemplate.php(249): SkinTemplate->prepareQuickTemplate() #4 /opt/htdocs/mediawiki/includes/OutputPage.php(2442): SkinTemplate->outputPage() #5 /opt/htdocs/mediawiki/includes/exception/MWExceptionRenderer.php(135): OutputPage->output() #6 /opt/htdocs/mediawiki/includes/exception/MWExceptionRenderer.php(54): MWExceptionRenderer::reportHTML(Object(Error)) #7 /opt/htdocs/mediawiki/includes/exception/MWExceptionHandler.php(75): MWExceptionRenderer::output(Object(Error), 2) #8 /opt/htdoc in /opt/htdocs/mediawiki/extensions/WhoIsWatching/src/Hook.php on line 40

djflux commented 6 years ago

Looks like there is an issue with src/Hook.php - the following patch to WhoIsWatching in mediawiki/extenstions resolves the issue for me. @hexmode in meza riot.im channel confirmed this fix:

diff --git a/src/Hook.php b/src/Hook.php
index ac87c3f..117e955 100644
--- a/src/Hook.php
+++ b/src/Hook.php
@@ -18,6 +18,7 @@

 namespace WhoIsWatching;

+use Article;
 use GlobalVarConfig;
 use QuickTemplate;
 use RequestContext;
hexmode commented 6 years ago

https://gerrit.wikimedia.org/r/#/c/436551/

jamesmontalvo3 commented 6 years ago

@krisfield where specifically are you seeing the multiple-instance issue?

@djflux @hexmode 30.x-php7 branch pulls the latest REL1_30 branch of WhoIsWatching, which appears to have this fix...so I think we're good there.

Sorry for the long delay. Was out on vacation and came back to too much work.

jamesmontalvo3 commented 6 years ago

@krisfield the issue was because in forms using WikiEditor, WikiEditor was not explicitly called out. So fields would have |editor| specified rather than |editor=wikieditor|. This was okay in older versions of Page Forms, because there was only one special editor. Newer versions also have TinyMCE as an editor, and forms need to clearly indicate one or the other.