meeting-room-booking-system / mrbs-code

MRBS application code
Other
117 stars 57 forks source link

PHP warning Please check your config file. The variable $min_book_ahead_enabled is no longer #2659

Open jberanek opened 4 years ago

jberanek commented 4 years ago

Hi For the last couple of days, I have been trying configure MRBS on one of the machines. Got IIS, Php, phpmyadmin, and Mysql configured. Now I am stuck on this error when I try to access MRBS Please see below Any help will be greatly appreciated!


PHP Warning: Please check your config file. The variable $min_book_ahead_enabled is no longer used and has been replaced by $min_create_ahead_enabled and $min_delete_ahead_enabled. in C:\inetpub\wwwroot\mrbs\web\internalconfig.inc.php on line 81 PHP Warning: Please check your config file. The variable $max_book_ahead_enabled is no longer used and has been replaced by $max_create_ahead_enabled and $max_delete_ahead_enabled. in C:\inetpub\wwwroot\mrbs\web\internalconfig.inc.php on line 91 PHP Warning: Please check your config file. The variable $min_book_ahead_secs is no longer used and has been replaced by $min_create_ahead_secs and $min_delete_ahead_secs. in C:\inetpub\wwwroot\mrbs\web\internalconfig.inc.php on line 101 PHP Warning: Please check your config file. The variable $max_book_ahead_secs is no longer used and has been replaced by $max_create_ahead_secs and $max_delete_ahead_secs. in C:\inetpub\wwwroot\mrbs\web\internalconfig.inc.php on line 111

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1964

jberanek commented 4 years ago

The machine I am trying to configure it on is a Windows 10 x 64 bit.

Original comment by: *anonymous

jberanek commented 4 years ago

In older versions of MRBS there were config settings $min_book_ahead_enabled and $min_book_ahead_secs, which allowed you to specify a minimum time in the future before bookings can be made, edited or delete. This setting has now been split into two different settings, one for creating bookings and another for deleting bookings. (Deleting includes editing). This means that you can, for example, set a policy which allows you to prevent users from deleting or changing bookings which are less than a week in advance, but still allow new ones to be made.

It looks like your MRBS config.inc.php file still has the $min_book_ahead_enabled and $min_book_ahead_secs settings. You need to change those to be $min_create_ahead_enabled and $min_delete_ahead_enabled and $min_create_ahead_secs and $min_delete_ahead_secs.

The same applies for $max_book_ahead_enabled and $max_book_ahead_secs.

Original comment by: campbell-m

jberanek commented 4 years ago

Thank you so much for your timely response Campbell. I really appreciate it! I am an IT support specialist at a High school and have been using MRBS for our resource booking for the last 4 years. The machine (Windows 7 x 32) that it’s currently running from has to be decommissioned so I am installing MRBS on a new machine (Windows 10 x 64 bit) and finally got it working.

The cause of the PHP warning was that this line in config.inc.php was commented out, after I removed the “//” it started working on my new machine.

//$db_schema = "public";

Also, I am attaching our school’s config.inc.php that I am currently using under mrbs on my win 10 machine and would be grateful if you could tell me where I have to change min_book to min_create and min_delete. For the time being I commented out these lines under the section called “Booking policies”. Please see attached.

Just so you know, I have removed our company's name and password from config.inc.php. before attaching here.

I tried to backup MRBS from our existing system but when I import into the new machine, mrbs breaks on it and displays the same PHP warning messages probably because it overwrites all the php files. So I removed the comment from this line again to make it work again. It's good now. //$db_schema = "public";

I guess we will recreate areas, not a big deal.
Keep up the good work, thank you so much once again!!

Original comment by: *anonymous

jberanek commented 4 years ago

Current MRBS with areas and data

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/5f3c47a1a9/522a/attachment/mrbs1.PNG

jberanek commented 4 years ago

I'll reply more fully tomorrow, but in the meantime:

(1) Which versions of MRBS are you using on which machines? (2) I've deleted the config file from the post above as it looked as though it contained some usernames and passwords. You can always reinstate it if you're happy publishing it.

Original comment by: campbell-m

jberanek commented 4 years ago

1) Windows 7 x 32 bit machine is running MRBS 1.4.10 (old system) Windows 10 x 64 bit machine is running MRBS 1.7.4.1 (new system) 2) Thank you for taking care of the security piece and deleting the file.

Take your time! It would be nice to have the areas and the data (i.e. bookings in the past and future of this school year), if possible, otherwise, we will print them out for reference.

Original comment by: *anonymous

jberanek commented 4 years ago

You should be able to move all your data and areas from the old server to the new server. Using phpMyAdmin for example, just Export the data from the old server and Import it to the new server. Once you've got your config file sorted out, when you first run MRBS on the new server it will prompt you to upgrade the database, by asking you to enter your database username and password.

However you need to get your config file sorted out first. In current versions of MRBS the config file is just used to override the default settings in systemdefaults.inc.php and areadefaults.inc.php. It should certainly not have that line require_once "language.inc"; // DO NOT DELETE THIS LINE in it anymore (despite the comment!). The best thing to do is to start from the sample config file and go through the settings in systemdefaults.inc.php and areadefaults.inc.php adding the ones you want to change.

One thing I don't understand is that comenting out the line //$db_schema = "public"; seemed to make it work. This setting isn't used for MySQL databases and shouldn't make any difference. I suspect it was just coincidence that it started working after you commented out that line and it was some other change that made the difference.

Once you've got everything working you might want to consider changing your $auth["type"] from 'config' to 'db'. It's much easier to manage your users using the db scheme: you do it through the browser rather than having to edit the config file.

Original comment by: campbell-m

jberanek commented 4 years ago

You should be able to move all your data and areas from the old server to the new server. Using phpMyAdmin for example, just Export the data from the old server and Import it to the new server. Once you've got your config file sorted out, when you first run MRBS on the new server it will prompt you to upgrade the database, by asking you to enter your database username and password. *That is exactly what I did i.e. using phpmyadmin to export data from the old server to the new and it was breaking mrbs. Also, now I have already executed MRBS on the new server so it won't be the first time execution. "

However you need to get your config file sorted out first. In current versions of MRBS the config file is just used to override the default settings in systemdefaults.inc.php and areadefaults.inc.php. It should certainly not have that line require_once "language.inc"; // DO NOT DELETE THIS LINE in it anymore (despite the comment!). The best thing to do is to start from the sample config file and go through the settings in systemdefaults.inc.php and areadefaults.inc.php adding the ones you want to change. I am going to go through config file on the old server and will also remove the line you indicated above. I will follow your instructions.

One thing I don't understand is that comenting out the line //$db_schema = "public"; seemed to make it work. This setting isn't used for MySQL databases and shouldn't make any difference. I suspect it was just coincidence that it started working after you commented out that line and it was some other change that made the difference. I am not sure about this either and just commented this line again and mrbs is still working so not sure what went wrong there.

Once you've got everything working you might want to consider changing your $auth["type"] from 'config' to 'db'. It's much easier to manage your users using the db scheme: you do it through the browser rather than having to edit the config file.

will give this a try after gettting everything sorted out

Original comment by: *anonymous

jberanek commented 4 years ago

Also, now I have already executed MRBS on the new server so it won't be the first time execution.

Did it prompt you for a database username and password and then go through the upgrade process? If not then something has gone wrong - always assuming you are running MRBS 1.7.4.1 on the new server.

Original comment by: campbell-m

jberanek commented 4 years ago

No it didn't when I imported it into the new mrbs using phpmyadmin Yes I am running MRBS 1.7.4.1 on the new server.

Original comment by: *anonymous

jberanek commented 4 years ago

Should I drop the database in phpmyadmin on the new server and import again?

Original comment by: noureen

jberanek commented 4 years ago

Yes. Something has definitely gone wrong. You should definitely be prompted to go through the upgrade process.

Original comment by: campbell-m

jberanek commented 4 years ago

Ok, I will do next week. Thank you.

Original comment by: noureen

jberanek commented 4 years ago

Thank you very much for your help! I was able to create areas/rooms in our new system and everything is running smoothly. You may close the ticket if you want.

Original comment by: noureen