Page 1 of 1

Install failing

Posted: Jul 20, 2016 10:47 am
by darkjin
I downloaded the version from ...
I have it in the plugins directory: .../plugins/EmailReporter
Clicking the install action on the manage plugins page brings me to a: The mantis page isn’t working, HTTP ERROR 500.
I have tested of other plugins work such as Gantt and they all install successfully. My logs are displaying this error:

[Wed Jul 20 15:30:06 2016] [error] [client x.x.x.x] PHP Fatal error: Can't use function return value in write context in /srv/www/public_html/mantis/plugins/EmailReporting/core/config_api.php on line 912, referer: http://mantis/mantis/manage_plugin_page.php

Re: Install failing

Posted: Jul 20, 2016 1:42 pm
by darkjin
Solved the problem. If anyone encounters the same issue check this FOR THE ROOT ERROR
You can see that the empty() function gets passed another function. It should only be getting passed a variable.

A fix would be to create a variable that called the function and pass that into empty().

if ( !user_exists( $t_single_user_id ) || empty( user_get_accessible_projects( $t_single_user_id ) )

$temp_single_user_id = user_get_accessible_projects($t_single_user_id)
if ( !user_exists( $t_single_user_id ) || empty( $temp_single_user_id ))

Re: Install failing

Posted: Jul 20, 2016 3:59 pm
by SL-Gundam
Will modify the code as suggested but this was not an issue running PHP 5.6.x or PHP 7.0.x

So i'm curious which version of PHP you're running on your server ... 3642d95191

Re: Install failing

Posted: Jul 21, 2016 7:51 am
by darkjin
Running PHP 5.3.3

Re: Install failing

Posted: Jul 21, 2016 10:19 am
by SL-Gundam
Good to know older versions don't support using the empty function this way

Thank you for reporting this