Need help troubleshooting error

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

Moderators: Developer, Contributor

Post Reply
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Need help troubleshooting error

Post by mushu »

Updated Mantis from 2.25.2 to 2.25.7 and then updated EmailReporting to 0.11-DEV version (although git still only shows 0.10 as latest).

When I'm testing my changes I get the following error and not sure where to go to start troubleshooting, need suggestions please!

Code: Select all

Done checking all mailboxes
SYSTEM WARNING: 'Creating default object from empty value' in 'C:\MantisBT2257\core\email_api.php' line 1333
This comes after manually running bug_report_mail.php on command line. That particular line of code in mail_api.php is in function cleanup_project_name($p_project_name):

Code: Select all

return( $t_project_name );
Since I don't know php I'm not sure how to test to see if this is actually the module returning that error or if it is in fact coming from somewhere else.

If I could supporess that warning message so the code doesn't return an errorlevel value then my batch file would continue processing normally. But I want it to die when any error is thrown, not on warnings. So, either I fix this warning or I prevent php from throwing all warnings. but not sure how to go about doing either.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Need help troubleshooting error

Post by SL-Gundam »

'C:\MantisBT2257\core\email_api.php' is a MantisBT file, not EmailReporting.
https://github.com/mantisbt/mantisbt/bl ... .php#L1333

The question is what piece of code called the function.
My advise is to add the code below to your config_inc.php. It should show a lot more info about what's happening and why.

Code: Select all

	$g_show_detailed_errors	= ON;

	$g_display_errors = array(
		E_RECOVERABLE_ERROR => DISPLAY_ERROR_HALT,
		E_WARNING => DISPLAY_ERROR_HALT,
		E_NOTICE => DISPLAY_ERROR_HALT,
		E_USER_ERROR => DISPLAY_ERROR_HALT,
		E_USER_WARNING => DISPLAY_ERROR_HALT,
		E_USER_NOTICE => DISPLAY_ERROR_HALT,
		E_ALL => DISPLAY_ERROR_HALT,
		E_DEPRECATED => DISPLAY_ERROR_HALT
	);
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Need help troubleshooting error

Post by mushu »

Okay I see this in the log file:

Code: Select all

C:\MantisBT2257\core\template_api.php: 150: - - - - error_handler( <integer>8, <string>'Undefined variable: t_private', <string>'C:\\MantisBT2257\\core\\template_api.php', <integer>150, <array> { ['p_bugnote'] => <Object><BugnoteData> ( [id] => '11158', [bug_id] => 4487, [reporter_id] => 864, [note] => 'blahblah'...
 
And that line of code in the template_api.php file is:

Code: Select all

$variables['private'] =  $t_private;
Any thoughts on a solution? That template_api.php file hasn't been changed since the v2.25.2 of Mantis.
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Need help troubleshooting error

Post by mushu »

I think I figured it out. It was the new fix for their 15 year old memory leak that I had to undo to get everything to work again. See: viewtopic.php?p=74203#p74203
Post Reply