Skip to content
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

Fix three fatal errors with MediaWiki 1.36.0+ #41

Merged
merged 8 commits into from Jun 4, 2021

Conversation

Universal-Omega
Copy link
Contributor

@Universal-Omega Universal-Omega commented May 27, 2021

  • MWTidy::factory no longer exists, therefore it gives fatal error, "Error: Call to undefined method MWTidy::factory()"

    • Maintains backward compatibility
  • Too few arguments to function Parser::__construct(), 0 passed in extensions/PortableInfobox/includes/services/Helpers/PortableInfoboxParsingHelper.php on line 29 and exactly 16 expected

    • Maintains compatibility with MediaWiki 1.29+
  • Replace $wgContLang which was removed on 1.36.

    • Mantains compatability with 1.32+; drops compatability with everything before that. I can fix it to maintain full compatability but I don't see the real need to.

    Also there is additional errors/warnings not fixed in this, such as:
    ParserOptions being created without a UserIdentity object [Called from unknown in extensions/PortableInfobox/includes/services/Helpers/PortableInfoboxParsingHelper.php at line 31] in includes/debug/MWDebug.php on line 376

@Universal-Omega Universal-Omega changed the title MWTidy::factory no longer exists MWTidy::factory no longer exists; gives fatal May 27, 2021
@Universal-Omega Universal-Omega changed the title MWTidy::factory no longer exists; gives fatal Fix "Error: Call to undefined method MWTidy::factory()" May 27, 2021
@Universal-Omega Universal-Omega changed the title Fix "Error: Call to undefined method MWTidy::factory()" Fix fatal "Error: Call to undefined method MWTidy::factory()" May 27, 2021
@Universal-Omega
Copy link
Contributor Author

Universal-Omega commented May 27, 2021

@lkucharczyk can you please review/merge this as soon as possible, as 1.36.0 came out today and this gives a fatal on the most recent stable MediaWiki version.

@Universal-Omega Universal-Omega changed the title Fix fatal "Error: Call to undefined method MWTidy::factory()" Fix two fatal errors May 28, 2021
@Universal-Omega Universal-Omega changed the title Fix two fatal errors Fix two fatal errors with MediaWiki 1.36.0+ May 28, 2021
@Hb1290
Copy link

Hb1290 commented Jun 1, 2021

I'd just like to add that this issue is likely related and has been affecting 1.35 as well

@Universal-Omega
Copy link
Contributor Author

I'd just like to add that this issue is likely related and has been affecting 1.35 as well

I've used PortableInfobox on 1.35 since 1.35 was released and never had this issue until 1.36.

@Hb1290
Copy link

Hb1290 commented Jun 1, 2021

I'd just like to add that this issue is likely related and has been affecting 1.35 as well

I've used PortableInfobox on 1.35 since 1.35 was released and never had this issue until 1.36.

It's only in the last couple of weeks that it's come up. I was starting to roll them out across my wiki but one of my fellow admins had to revert my edits because the errors started like a day after I'd added them on some pages. We're on Miraheze so we're running 1.35.2

@Universal-Omega
Copy link
Contributor Author

Universal-Omega commented Jun 1, 2021

I'd just like to add that this issue is likely related and has been affecting 1.35 as well

I've used PortableInfobox on 1.35 since 1.35 was released and never had this issue until 1.36.

It's only in the last couple of weeks that it's come up. I was starting to roll them out across my wiki but one of my fellow admins had to revert my edits because the errors started like a day after I'd added them on some pages. We're on Miraheze so we're running 1.35.2

Yes, my personal wiki on Miraheze does not have this issue. I did this PR to fix it on Miraheze for 1.36.0, prior to us upgrading to 1.36. The issues fixed here would not effect 1.35 at all, as the functions exist on there.

@Universal-Omega Universal-Omega changed the title Fix two fatal errors with MediaWiki 1.36.0+ Fix three fatal errors with MediaWiki 1.36.0+ Jun 2, 2021
@lkucharczyk lkucharczyk merged commit eb05dd2 into lkucharczyk:master Jun 4, 2021
'pwrap' => false
] );
if ( version_compare( MW_VERSION, '1.36', '>=' ) ) {
$this->tidyDriver = MediaWikiServices::getInstance()->getTidy();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not setting the pwrap option affect the output in any negative way? I don't remember why exactly I had to set it to false and I can't really test that at the moment. I know that now it's only possible to grab Tidy with predefined config now, so maybe it would be better for us to set $wgPortableInfoboxUseTidy to false by default if default tidy config causes any problems?

I merged this anyway, to get any working version, but if you could make sure that's not a problem, that'd be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I tested it before this PR. It seemed to work.

One other unrelated thing, I was wondering if I can have merge rights to this repository to help maintain the extension? And have you considered moving to Wikimedia Gerrit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants