multidimension-al / phpbbauth

A Mediawiki extension for phpBB authentication using Auth_remoteuser.
MIT License
5 stars 5 forks source link

500 error #13

Open Leader-board opened 1 year ago

Leader-board commented 1 year ago

Latest versions of phpBBauth and Auth-RemoteUser. MediaWiki 1.39.3 and phpBB 3.3

The MediaWiki and php error logs show nothing relevant, which is making troubleshooting a headache. Assistance would be appreciated.

The error happens even when the user hasn't logged in - the wiki is as good as dead at that point (unless the extension is removed from LocalSettings.php).

orudge commented 1 year ago

The problem appears to be a conflict between the versions of vendor/psr/container/src/ContainerInterface.php used in phpBB and MediaWiki. The phpBB version declares public function get($id); while the MediaWiki version declares public function get(string $id);.

It looks like replacing the phpBB version with the MediaWiki version works, apparently not breaking phpBB, but I haven't tested it extensively yet.

MedicineStorm commented 1 year ago

Can confirm. I actually implemented the inverse; replacing the MediaWiki version with the phpBB version. It's been a few months now, and no known issues have shown up as a result of this change.

MedicineStorm commented 1 year ago

Looks like a future version of MW may include this same change as well: https://gerrit.wikimedia.org/r/c/mediawiki/libs/Services/+/818406/3/src/ServiceContainer.php

orudge commented 1 year ago

Looks like a future version of MW may include this same change as well: https://gerrit.wikimedia.org/r/c/mediawiki/libs/Services/+/818406/3/src/ServiceContainer.php

It looks like that change was abandoned and the case closed (https://phabricator.wikimedia.org/T314116), so this may still need to be manually fixed in future versions unless phpBB updates their version.

ajquick commented 1 year ago

Thank you for the information. I actually missed this bug completely.

Could you help detail what you did to fix it? Or is it something that needs to be done in the core of phpBB or Mediawiki?

On Fri, Aug 25, 2023, 2:20 AM Owen Rudge @.***> wrote:

Looks like a future version of MW may include this same change as well: https://gerrit.wikimedia.org/r/c/mediawiki/libs/Services/+/818406/3/src/ServiceContainer.php

It looks like that change was abandoned and the case closed ( https://phabricator.wikimedia.org/T314116), so this may still need to be manually fixed in future versions unless phpBB updates their version.

— Reply to this email directly, view it on GitHub https://github.com/multidimension-al/phpbbauth/issues/13#issuecomment-1692961234, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSIOS5GNL7RXCBTZZVLUPLXXBN4BANCNFSM6AAAAAAZ235GSA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MedicineStorm commented 1 year ago

in [WIKI ROOT]/vendor/wikimedia/services/src/ServiceContainer.php find public function get( string $name ) { and change it to public function get( $name ) { Also, in the same file, find public function has( string $name ): bool { and change it to public function has( $name ): bool {

orudge's solution is to alter the phpBB equivalent, and does not include the additional change to the has function. Both/either solutions should work. Personally, I changed it in mediawiki instead of phpbb because I have other objects interfacing with it besides phpBB and they are all expecting to be able to pass mixed types. The recent addition of type hinting on these functions breaks those interactions. However, the removal of the type hinting has not created any issues or errors in the months since I made the change.

Note

This "fix" is being made to components that are not really part of phpbbauth, but instead made to parts of phpBB or MediaWiki core (kinda. It's vendor services, so not technically "core"? Regardless, its a change to files outside of this extension). I think the only reason it's happening as a bug in phpbbauth is because there aren't that many extensions that happen to use those particular vendor service functions, so no one else has even noticed.

ajquick commented 1 year ago

This is all good to hear. I wonder if it only applies to users using PHP >= 7.0?

And is there a warning level on PHP where it can ignore the type hinting?