function.mail not working after update
Brought to you by:
jberanek
Hello,
i updatet MRBS to 1.11 but i have a failure in the functions.mail
I added some extra functions in the file so i can show some extra infos
at the email. Unfortunaly the extra infos are not shown anymore?
I compared the files and recongnized minor changes (compare old to new email, Email.EOL? etc.)
Do you have an idea, how i can bind my changes to the new "system"?
See also file attached
THX Steve
Uncaught exception 'TypeError' in C:\xampp\htdocs\mrbs\web\functions_mail.inc at line 252
MRBS\create_body_table_row(): Argument #3 ($old) must be of type string, null given, called in C:\xampp\htdocs\mrbs\web\functions_mail.inc on line 940
Uncaught exception 'TypeError' in C:\xampp\htdocs\mrbs\web\functions_mail.inc at line 252
MRBS\create_body_table_row(): Argument #3 ($old) must be of type string, null given, called in C:\xampp\htdocs\mrbs\web\functions_mail.inc on line 940
#0 C:\xampp\htdocs\mrbs\web\functions_mail.inc(940): MRBS\create_body_table_row('Headsets f\xC3\xBCr B...', '0', NULL, true, false)
#1 C:\xampp\htdocs\mrbs\web\functions_mail.inc(1267): MRBS\create_body(Array, Array, true, false, 'book', Array, false, NULL)
#2 C:\xampp\htdocs\mrbs\web\mrbs_sql.inc(2771): MRBS\notifyAdminOnBooking(Array, Array, false, false, Array)
#3 C:\xampp\htdocs\mrbs\web\edit_entry_handler.php(846): MRBS\mrbsMakeBookings(Array, 3494, false, false, 2, true, '')
#4 {main}
MRBS GET: Array
(
)
MRBS POST: Array
(
[csrf_token] => a599cfe7843b4dbc07ed4eb90c03f4ddd7996557694791e920614ebb77215669
[returl] => https://mrbs/index.php?view=day&view_all=1&page_date=2023-06-09&area=1&room=2
[edit_type] =>
[original_room_id] => 2
[ical_uid] => MRBS-6479d7357f874-7e2dc160@mrbs
[ical_sequence] => 0
[id] => 3494
[f_KS] => 2050
[f_PS] => 2
[f_Leiter] => TEST
[name] => TEST
[create_by] => M04214
[description] =>
[start_date] => 2023-06-09
[start_seconds] => 43200
[end_date] => 2023-06-09
[end_seconds] => 46800
[rooms] => Array
(
[0] => 2
)
[type] => A
[f_MC] => on
[f_LS] => 1
[f_GS] => 1
[f_PSA] => 0
[f_HS] => 0
[f_info] => TEST
[f_Gesamtkosten] => 130
)
MRBS SESSION: Array
(
i tried to workauround the error message:
@cimorrison
$mail_previous[$key]:
if ($compare && isset($mail_previous[$key])) {
$previousValue = $mail_previous[$key];
if (!is_string($previousValue)) {
//its not a string, put a standard value in
$previousValue= ' ';
}
$mail_previous[$key] = $previousValue;
} else (
$mail_previous[$key] = ' ';
But i still get error messages anytime :-( I reinstalled all files and keep all files "vanilla" without modifications and still get following error messages:
I don't think you can have reinstalled all the vanilla files. Line 931 of functions_mail.inc in MRBS 1.11.0 is
Last edit: Campbell Morrison 2023-06-04
i download the file mrbs_main_code from github.
This is on line 931:
After using the file from Github, making an entry is working without error and emails are coming also. But integrating my calculation function is throwing errors at me
Anyways, it seems to me, that my modified "calc functions" didnt work anymore, with the "new" HTML -Email_EOL, parenthese around the HTML version something like that, but i am not sure!
Do you have any idea, how i can bind my modified function (normaly i put it between line 354 to 682) to the "new" layout?:
THX in Advance
Last edit: Campbell Morrison 2023-06-05
Ah, OK, you are using the latest development code rather than 1.11.0. That's fine.
What is the error you are getting now?
Dont ask me why, but i had to reformat the file funvtion.mail.inc to UTF-8. No more Error message are thrown at me,
but my added function "calc_price"(see function above) is not showing any result if i make an entry :-(
I add 2 minor functions:
if ($as_html)
{
$body .= create_price_calc($data); // Todo: Preise auf body ausgeben
$body .= '' . MAIL_EOL;
$body .= '' . MAIL_EOL;
$body .= '' . MAIL_EOL;
echo "Die Kantinenmitarbeiter stehen Ihnen im Servicezeitraum von 6:00-14:00 Uhr zur Verfügung";
}
return $body;
}
Unfortunaly there are no more any values shown, if i get the email :-(
You'll need to start debugging it using tools such as
var_dump()
to find out why it's not giving you anything.Last edit: Campbell Morrison 2023-06-05
I am not finished yet with fishing my errors, but i got 2 errors first in the funvtion_mail.inc:
and
Do you have any idea?
Last edit: Campbell Morrison 2023-06-07
That normally means that you don't have a form control, eg
<input>
with an id corresponding to thefor
attribute.Where are you seeing those error messages? If it's in your email then it's probably because
<label>
is the wrong kind of element to use there: it should only be used with a form control.