meeting-room-booking-system / mrbs-code

MRBS application code
Other
127 stars 62 forks source link

Upgrade issue from 1.7.1 to 1.7.3...again #2534

Open jberanek opened 5 years ago

jberanek commented 5 years ago

Hello,

I already wrote a message some time ago about this issue but I just can't seem to be able to fix it alone...

I'm using 1.7.1 with auth type set to 'config'. After I upgraded from 1.7.1 to 1.7.3, keeping the config.inc.php, which DID work ok under 1.7.1, I figured annoying messages being displayed and apparently related to the way I set up the email recipients.

First note that the booking is correctly set.

Messages displayed are herebelow:

EUSERNOTICE in /homepages/34/d291758973/htdocs/xxxx/functionsmail.inc at line 188
Invalid email address "administrator"

ENOTICE in /homepages/34/d291758973/htdocs/xxxx/functionsical.inc at line 868
Undefined index: areaname

ENOTICE in /homepages/34/d291758973/htdocs/xxxx/functionsical.inc at line 868
Undefined index: roomname

EWARNING in /homepages/34/d291758973/htdocs/xxxx/editentryhandler.php at line 789
Cannot modify header information - headers already sent by (output started at /homepages/34/d291758973/htdocs/xxxx/functionserror.inc:62)
MRBS GET: Array
(
)
MRBS POST: Array
(
    [csrftoken] => c74f590d1117054ad241dcc6a83a48d27bf9fe367dba802594538b6ef087c2db
    [returl] => http://xxxxxx.fr/month.php?year=2019&month=09&day=18&area=2&room=5
    [createby] => administrator
    [repid] => 0
    [edittype] => series
    [name] => Test
    [description] => Test
    [startdate] => 2019-09-04
    [startseconds] => 3600
    [enddate] => 2019-09-04
    [endseconds] => 7200
    [area] => 2
    [rooms] => Array
        (
            [0] => 5
        )

    [type] => I
    [confirmed] => 1
    [reptype] => 0
    [repday] => Array
        (
            [0] => 3
        )

    [repnumweeks] => 1
    [monthtype] => 0
    [monthabsolute] => 4
    [monthrelativeord] => 1
    [monthrelativeday] => WE
    [rependdate] => 2019-09-04
)
MRBS SESSION: Array
(
    [csrftoken] => c74f590d1117054ad241dcc6a83a48d27bf9fe367dba802594538b6ef087c2db
    [UserName] => administrator
)

I then decided to delete the booking and this also led to other warnings, although the booking has been correcty deleted :

E_USER_NOTICE in /homepages/34/d291758973/htdocs/xxxx/functions_mail.inc at line 188
Invalid email address "administrator"

E_WARNING in /homepages/34/d291758973/htdocs/xxxx/del_entry.php at line 114
Cannot modify header information - headers already sent by (output started at /homepages/34/d291758973/htdocs/xxxx/functions_error.inc:62)
MRBS GET: Array
(
)
MRBS POST: Array
(
    [csrf_token] => c74f590d1117054ad241dcc6a83a48d27bf9fe367dba802594538b6ef087c2db
    [id] => 516
    [series] => 0
    [returl] => month.php?year=2019&month=09&day=18&area=2&room=5
)
MRBS SESSION: Array
(
    [csrf_token] => c74f590d1117054ad241dcc6a83a48d27bf9fe367dba802594538b6ef087c2db
    [UserName] => administrator
)

As it definitely looks like being linked to the email system, could youplease tell me how tosimply define correctly the email-to part of the config file so that I and all the configured users can receive the booking info without generating all these warnings?

Thanks and best regards

Philippe

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1835

jberanek commented 5 years ago

I think this is just because you're displaying PHP errors to the browser, which you shouldn't be doing in "production"...

The following error is because errors have come out before MRBS has had a chance to send its HTTP headers:

Cannot modify header information - headers already sent by (output started at

Original comment by: jberanek

jberanek commented 5 years ago

While the errors from "Cannot modify header information - headers already sent by (output started at" are simply caused because you have 'display_errors' on, the first three are not and shouldn't be happening.

I'm not quite sure why you are getting the 'undefined index' errors and will need to think about that, but you are getting the "Invalid email address" error because, I suspect, you haven't set $mail_settings['domain'] in the config file. This is the domain name, eg example.com, that, when using the 'config' authentication type MRBS will append to all usernames to get their email address. Of course, this will only work if all your users share the same domain name.

If you want to have different domain names for different users then I recommend switching to the 'db' authentication scheme. (I'd recommend this anyway as it allows you to administer users through the browser, rather than by editing the config file.)

Original comment by: campbell-m

jberanek commented 5 years ago

I now understand the 'undefined index' problems and have fixed the bug in the mrbs_17_branch (10f55d) and default (1ecd3a) branches.

You can avoid the problem by setting

$mail_settings['details'] = true;

in your config file. Alternatively you can upgrade to the latest version of the MRBS 1.7 code, which you can get by following the Download Snapshot link on this page.

Original comment by: campbell-m

jberanek commented 5 years ago

Thanks much Campbell...Will give it a shot tomorrow... As far as the 'display_errors' stuff described by John, is this something coming from Firefox which I use or is it coming from elsewhere? Not sure I understand this...I don't believe I ever turned it 'on' anywhere :-)

Thanks

Philippe

Original comment by: *anonymous

jberanek commented 5 years ago

Ir comes from your PHP configuration in your php.ini file.

Original comment by: campbell-m

jberanek commented 5 years ago

OK...Will check this out.. Thanks much!

Original comment by: *anonymous

jberanek commented 5 years ago

Looks live everything's solved now. About php.ini display_errors: there was nocustom php.ini file defined so I created one and switched errors off. I guess my hosting company had this turned on by default.

Thanks again for your help!

Philippe

Original comment by: *anonymous