Page 3 of 5

Re: Email output could be much prettier

Posted: 26 Oct 2020, 17:30
by mushu
Yay! It's working now. Okay now that I'm getting the correct output I can start to really test it...will post issues as I find them. Thanks again!

Re: Email output could be much prettier

Posted: 26 Oct 2020, 17:35
by mushu
So still getting errors from bad index, so I added "@" in front of those variables to hide the error...although a bad index sounds important to not just ignore lol.

$variables['severity'] = get_enum_element( 'severity', $issue_data['email_severity'], auth_get_current_user_id(), @$issue_data['project_id'] );
$variables['status'] = get_enum_element( 'status', $issue_data['email_status'], auth_get_current_user_id(), @$issue_data['project_id'] );
$variables['priority'] =get_enum_element( 'priority', $issue_data['email_priority'], auth_get_current_user_id(),@$issue_data['project_id'] );
$variables['tags'] = @$issue_data['email_tag'];

Re: Email output could be much prettier

Posted: 26 Oct 2020, 17:37
by mushu
Yeah not able to use it, now entering a new issue gets me this error:

SYSTEM NOTICE

'Undefined index: email_due_date' in 'C:\MantisBT2243\core\template_api.php' line 24

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

Re: Email output could be much prettier

Posted: 26 Oct 2020, 18:34
by cas
Change error reporting to Error only, it will remove the system notices. That way you can continue. I will review these notices later :mrgreen:

Re: Email output could be much prettier

Posted: 26 Oct 2020, 19:06
by mushu
Got it. DISPLAY_ERROR_NONE

Thanks. Everything seems to be working fine. Made a few changes to the CSS but otherwise I removed all "@" in front of variables since errors are now ignored. Hope that doesn't bite me in the butt.

Re: Email output could be much prettier

Posted: 26 Oct 2020, 19:26
by cas
No it will not for now. I will change my setup to display all messages and will fix them somewhere this week. Then I will post version 3 :D

Re: Email output could be much prettier

Posted: 26 Oct 2020, 20:32
by cas
if you open up my bug_mailtemplate.html, you can remove the comment tags on line 76 and 80.
Next you will get additional information in the overview:
- The array that holds all data
- The referer from which the script is called.

Most of the index errors you mention, I cannot reproduce. Due_date, Project_id etcetera are normal valid fields which should be present in the array.
Please check and let me know what you find.

Re: Email output could be much prettier

Posted: 26 Oct 2020, 20:45
by mushu
referrer = /bug_report_page.php

all history = Date Username What Change
2020-10-26 13:41 usr1 New Issue
2020-10-26 13:41 usr1 Status new => assigned
2020-10-26 13:41 usr1 Assigned To => usr1

But of course this is still ignoring errors using the constant above.

Re: Email output could be much prettier

Posted: 26 Oct 2020, 20:50
by cas
You have activated 3 lines, most interesting is the last one. This print the array with all available data.

Re: Email output could be much prettier

Posted: 14 Jan 2021, 21:44
by mushu
Is there a nice list of every file that needs to be kept from being overwritten when upgrading to a new version? We are using v2.24.3 and need to upgrade to the latest so we don't fall too far behind. We have already updated our PHP from v5 to v7 so should be good there for a while.

I just know that if I blindly copy over the existing files our beautiful email templates will go away and we don't want that to happen! if there was a single place that listed every file that was modified and where they belong, then i could go through and run a diff on the old/new files and recreate the code changes in the latest version when i do the upgrade on our server.

TIA!

Re: Email output could be much prettier

Posted: 15 Jan 2021, 09:23
by cas
in this case changes made within mail_api.php , residing in the core directory ( as described in the readme) :mrgreen:

Re: Email output could be much prettier

Posted: 15 Jan 2021, 14:10
by mushu
So that is the only file that changed? I did all of this too long ago to remember, sorry.

Also, where can I download the latest version of this so I can re-enable error messages?

Re: Email output could be much prettier

Posted: 15 Jan 2021, 15:08
by cas
last one is attached to this forum thread on page 1 :D

Re: Email output could be much prettier

Posted: 15 Jan 2021, 15:10
by mushu
cas wrote: 26 Oct 2020, 19:26 I will change my setup to display all messages and will fix them somewhere this week. Then I will post version 3 :D
Specifically I'm waiting for this release so I can turn on error messages again. ;-)

Re: Email output could be much prettier

Posted: 15 Jan 2021, 16:08
by cas
ah, started that at the time but nevergot to finalizing it. Will have a :mrgreen: look since it is fairly easy