meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Error #2657

Open jberanek opened 4 years ago

jberanek commented 4 years ago

Hi

We sometimes get this error see attached image, when we want to create 3-4 user after each other

The error file writes this and there are many lines with the same error in it

What can we do? Version 1.7.1

/Bruno

[18-Dec-2019 11:39:42 Europe/Copenhagen] PHP Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /home/fribillund/public_html/booking/lib/PHPMailer/PHPMailerAutoload.php on line 45 [18-Dec-2019 11:39:42 Europe/Copenhagen] PHP Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/fribillund/public_html/booking/internalconfig.inc.php on line 497 [18-Dec-2019 11:39:42 Europe/Copenhagen] PHP Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/fribillund/public_html/booking/internalconfig.inc.php on line 498 [18-Dec-2019 11:39:42 Europe/Copenhagen] PHP Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/fribillund/public_html/booking/internalconfig.inc.php on line 499

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1962

Attachments: https://sourceforge.net/p/mrbs/support-requests/1962/attachment/image.png

jberanek commented 4 years ago

The best thing to do is to upgrade to the latest release, MRBS 1.7.4.1. But if you don't want to do that at the moment then you can suppress the deprecated messages by editing internalconfig.inc.php and changing lines 514-527 from

// Make sure notice errors are not reported, they can break mrbs code:
$error_level = E_ALL & !E_NOTICE & !E_USER_NOTICE;

if (defined("E_DEPRECATED"))
{
  $error_level = $error_level & !E_DEPRECATED;
}

// The Mail and Net libraries generate E_STRICT errors, so disable E_STRICT (which became
// part of E_ALL in PHP 5.4)
if (defined("E_STRICT"))
{
  $error_level = $error_level & !E_STRICT;
}

to

// Make sure notice errors are not reported, they can break mrbs code:
$error_level = E_ALL & ~E_NOTICE & ~E_USER_NOTICE;

if (defined("E_DEPRECATED"))
{
  $error_level = $error_level & ~E_DEPRECATED;
}

// The Mail and Net libraries generate E_STRICT errors, so disable E_STRICT (which became
// part of E_ALL in PHP 5.4)
if (defined("E_STRICT"))
{
  $error_level = $error_level & ~E_STRICT;
}

Original comment by: campbell-m

jberanek commented 4 years ago

Thanks

Original comment by: *anonymous

jberanek commented 4 years ago

Now I get this error in the buttom of the page

E_WARNING in /home/stavtrupgrund/public_html/trailerbooking/functions.inc at line 2281
count(): Parameter must be an array or an object that implements Countable
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => fb194479167e1721079e84a943cd13bfad080194e0e17c903273e888ce8d05e6
)

Original comment by: *anonymous

jberanek commented 4 years ago

What have you got $booking_types set to in your config file?

Original comment by: campbell-m

jberanek commented 4 years ago
/* Add lines from systemdefaults.inc.php and areadefaults.inc.php below here
   to change the default configuration. Do _NOT_ modify systemdefaults.inc.php
   or areadefaults.inc.php.  */
unset($booking_types);    // Include this line when copying to config.inc.php
$booking_types[] = "E";
$booking_types[] = "I";

// If you don't want to use types then uncomment the following line.  (The booking will
// still have a type associated with it in the database, which will be the default type.)
unset($booking_types);

Original comment by: *anonymous

jberanek commented 4 years ago

This is a bug. I will fix it in the code but in the meantime you can get round it by setting

$booking_types[] = "I"; // or whatever your default type is

after the code above in the config file. This will give you just one booking type, which means they will still be ignored.

Original comment by: campbell-m

jberanek commented 4 years ago

I have now fixed this in the mrbs_17_branch (a710db) and default (321ce2) branches.

Original comment by: campbell-m

jberanek commented 4 years ago

It's worth pointing out that outputting errors to the "display" is considered a bad idea. Outputting to the PHP log is a much better idea.

Original comment by: jberanek

jberanek commented 4 years ago

Hi

I have now updatet to version 1.7.4.1, but I get this error in the buttom of the frontpage

E_WARNING in /home/stavtrupgrund/public_html/test_trailer/web/functions.inc at line 1348
count(): Parameter must be an array or an object that implements Countable
MRBS GET: Array
(
    [year] => 2020
    [month] => 01
    [day] => 26
    [area] => 1
    [room] => 3
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => 65a37778615b0f03f1c253087ddb34a26f87ad0c7df4a8839a5e2fba9b6ca05d
)

And if I want to make a booking this is comming in the top of the page

E_WARNING in /home/stavtrupgrund/public_html/test_trailer/web/edit_entry.php at line 569
count(): Parameter must be an array or an object that implements Countable
MRBS GET: Array
(
    [area] => 1
    [room] => 4
    [hour] => 24
    [minute] => 0
    [year] => 2020
    [month] => 1
    [day] => 26
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => 65a37778615b0f03f1c253087ddb34a26f87ad0c7df4a8839a5e2fba9b6ca05d
    [UserName] => bruno
)

Original comment by: *anonymous

jberanek commented 4 years ago

You need to upgrade to the latest code in the mrbs_17_branch. Follow the Download Snapshot link on that page and treat it like an upgrade release. (I have just fixed a few more instances of this problem).

Original comment by: campbell-m

jberanek commented 4 years ago

... or else you can get round the problem by setting

$booking_types[] = "I"; // or whatever your default type is

Original comment by: campbell-m

jberanek commented 4 years ago

Ok thanks it works now :-)

Original comment by: *anonymous