FriendsOfFlarum / user-directory

The permission based public user directory extension for your Flarum forum.
https://discuss.flarum.org/d/5682
MIT License
22 stars 20 forks source link

Undefined variable: forum #32

Closed anysite closed 5 years ago

anysite commented 5 years ago

Installing ^0.3.2 on core v0.1.0-beta.9 No previous installation of Flagrow package.

Navigate to /users produce this error:

compact(): Undefined variable: forum in FALARUM_BASE_DIR/vendor/fof/user-directory/src/Content/UserDirectory.php on line 72 
clarkwinkelmann commented 5 years ago

Thanks for the report ! Will fix ASAP.

Are you on PHP 7.3 by any chance ? Because I never encountered that error on my 7.1 and 7.2 dev setups.

anysite commented 5 years ago

Yes. it is PHP 7.3.7.

dsevillamartin commented 5 years ago

I remember Flarum also having this issue for some people. The forum variable was never initialized, and yet used, exactly like at https://github.com/FriendsOfFlarum/user-directory/blob/master/src/Content/UserDirectory.php#L73.

clarkwinkelmann commented 5 years ago

Additional note: it was only a PHP Notice, so it wouldn't be shown if warnings and notices were hidden as they should be in production :wink: