Open florencebejo opened 1 year ago
The package was working mostly fine for us until we updated our php version to php8. Since then it seems that the helpers do not get loaded properly.
https://github.com/turnermm/news/blob/556847f949768b96135e679bf8654b23bf96ef16/action.php#L36
throws the error "Error: Call to a member function has_permission() on null".
--EDIT:
On the Backward Incompatible Changes page for PHP80, they mention
Methods with the same name as the class are no longer interpreted as constructors. The __construct() method should be used instead.
__construct()
So I think that replacing https://github.com/turnermm/news/blob/556847f949768b96135e679bf8654b23bf96ef16/action.php#L24 by public function __construct(){ should solve it.
public function __construct(){
I do not program in PHP so I would like someone with a bit more experience in the language to check it before making a merge pull request...
Great, I probably would not have found this - I made a pull request, you can install the updated plugin "manually" from https://github.com/wolfgangasdf/dokuwiki-plugin-news/archive/refs/heads/master.zip
The package was working mostly fine for us until we updated our php version to php8. Since then it seems that the helpers do not get loaded properly.
https://github.com/turnermm/news/blob/556847f949768b96135e679bf8654b23bf96ef16/action.php#L36
throws the error "Error: Call to a member function has_permission() on null".
--EDIT:
On the Backward Incompatible Changes page for PHP80, they mention
So I think that replacing https://github.com/turnermm/news/blob/556847f949768b96135e679bf8654b23bf96ef16/action.php#L24 by
public function __construct(){
should solve it.I do not program in PHP so I would like someone with a bit more experience in the language to check it before making a merge pull request...