tessus / mwExtensionMantis

MediaWiki Extension:Mantis
https://www.mediawiki.org/wiki/Extension:Mantis
GNU General Public License v2.0
2 stars 6 forks source link

Mediawiki crashes is using version 2.0 #29

Closed pedwik closed 7 years ago

pedwik commented 7 years ago

When using version 2.0, my MediaWiki crashes. If reverting back to 1.6 it works.

tessus commented 7 years ago

I'm sorry, but this does not help a bit.

How does it crash? What version of mediawiki? What's in the crash log? What is in the PHP error log?

pedwik commented 7 years ago

MediaWiki version is 1.20.3. The error message displayed in the browser is "This page isn’t working xxxx.org is currently unable to handle this request. HTTP ERROR 500" The only thing I do to make it work again is to replace Mantis.php version 2.0 with version 1.6. From the mediwiki's error log:

[15-Sep-2017 10:59:37 Europe/Stockholm] PHP Parse error: syntax error, unexpected '[' in .../public_html/mw/extensions/Mantis/Mantis.php on line 61 [15-Sep-2017 12:25:01 Europe/Stockholm] PHP Warning: preg_match() [function.preg-match]: Empty regular expression in .../public_html/mw/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php on line 430

Please tell me if you need more info, the mediawiki is on a shared hosting server but I can probably find out how to error logs from php too.

tessus commented 7 years ago

Hmm, the parse error is weird. I don't get it. I have to look into it. Maybe I forgot an edge case you triggered.

tessus commented 7 years ago

ah, wait. what PHP version are you using? < 5.4?

tessus commented 7 years ago

I changed array initializations to the new form, since I've noticed a weird side effect with the old one.

$a = array(); does not clear the array. If there are elements in the array, they will persist. Thus I changed them to $a = []; which is apparently not supported on PHP < 5.4.

tessus commented 7 years ago

I will create a separate branch tonight where I'll revert my changes related to arrays. Then it should work on PHP <5.4.

Please note that I can't really support setups which are out of support for years.

pedwik commented 7 years ago

I understand, maybe a good idea to add that as a requirement on the homepage too? The wiki is hosted where PHP is 5.6 as default, but the wiki installation obviously has its own PHP package. We got problems a couple of years ago with some extensions that stopped working and therefore sticked to 1.20.3.

tessus commented 7 years ago

Ok, I'll add that to the documentation too. I really did not think that I'd have to.

Even PHP 5.6 is out of support, let alone 5.3.

Ok, please try https://github.com/tessus/mwExtensionMantis/tree/ancient-php

Checkout branch ancient-php.

tessus commented 7 years ago

I won't be available for the next 4 hours. If you have any issues, please let me know. I'll look at them tonight or tomorrow.

pedwik commented 7 years ago

After updating to version 5.6 it works. It was very confusing in cpanel (we have the wiki on a shared hosting), it indicated that php 5.6 was used, but you had to select it and set it too....

tessus commented 7 years ago

Great. I believe upgrading PHP was long overdue. ;-)

Please note that PHP 5.6 is also out of support, but I don't think you will run in any issues with 5.6. At least not with my extension.

Closing this now.