Install failing

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
darkjin
Posts: 5
Joined: Jul 20, 2016 10:40 am

Install failing

Post 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

darkjin
Posts: 5
Joined: Jul 20, 2016 10:40 am

Re: Install failing

Post 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 ))

SL-Gundam
Posts: 606
Joined: Jul 06, 2011 9:17 am

Re: Install failing

Post 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

darkjin
Posts: 5
Joined: Jul 20, 2016 10:40 am

Re: Install failing

Post by darkjin »

Running PHP 5.3.3

SL-Gundam
Posts: 606
Joined: Jul 06, 2011 9:17 am

Re: Install failing

Post by SL-Gundam »

Good to know older versions don't support using the empty function this way

Thank you for reporting this

Post Reply