Page 1 of 1

Install failing

Posted: 20 Jul 2016, 15:47
by darkjin
I downloaded the version from https://github.com/mantisbt-plugins/Ema ... _0.9.2.zip.
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: 20 Jul 2016, 18:42
by darkjin
[SOLVED]
Solved the problem. If anyone encounters the same issue check this FOR THE ROOT ERROR http://pastebin.com/ycxxufjv.
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().

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


To:
$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: 20 Jul 2016, 20:59
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

https://github.com/mantisbt-plugins/Ema ... 3642d95191

Re: Install failing

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

Re: Install failing

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

Thank you for reporting this