WebsiteBaker Support (2.12.x) > General Help & Support

Booking 2.x error in DB table

<< < (2/5) > >>

dbs:
Yes, sounds like install problems.
You could upload all files again and then make a "upgrade" via i-button in the top menu.
 

DarkViper:
The error message looks like a mess of data types. This increasingly occurs in newer installations and strict database.
Let's see, maybe we can solve the problem on a 'short way'.

The error message states that the data field `group_id` should be assigned an invalid integer value.
That's completely right, because according to the code, a number is passed to the field as a string!
For example, null or an empty string are definitely not valid integers. Therefore, typecasts are needed for the values ​​to be sanitized.
Here are the instructions that fix this bug.

open the file modules/bookings/functions.php
scroll down to function Bookings_edit_Groups( $section = '' ) (around line 1788)
In this function you will find 3 SQL statements,
which you change as follows:

*
/* --- old ------------------------------------------- */
$sql   = "DELETE FROM ".TABLE_PREFIX."mod_bookings_groups WHERE "
          . "page_id = '$page_id' AND section_id = '$section' "
          . "AND group_id = '$group_id'";
/* --- new ------------------------------------------- */
$sql = 'DELETE FROM `'.TABLE_PREFIX.'mod_bookings_groups` '
        . 'WHERE `group_id`='.(int) $group_id; 

*
/* --- old ------------------------------------------- */
$sql = "UPDATE ".TABLE_PREFIX."mod_bookings_groups SET "
        . "name = '$group_name', color = '$color' "
        . "WHERE group_id = ".$modified_id;
/* --- new ------------------------------------------- */
$sql = 'UPDATE `'.TABLE_PREFIX.'mod_bookings_groups` '
        . 'SET `name`=\''.$database->escapeString($group_name).'\', '
        .     '`color`= \''.$database->escapeString($color).'\', '
        . 'WHERE `group_id`='.(int) $modified_id;

*
/* --- old ------------------------------------------- */
$sql = "INSERT INTO ".TABLE_PREFIX."mod_bookings_groups VALUES( "
        . "NULL, '$page_id', '$section', '$group_name', '$color'"
        . ")";
/* --- new ------------------------------------------- */
$sql = 'INSERT INTO `'.TABLE_PREFIX.'mod_bookings_groups` '
        . 'SET `page_id`='.(int) $page_id.', '
        .     '`section_id`='.(int) $section.', '
        .     '`name`=\''.$database->escapeString($group_name).'\', '
        .     '`color`= \''.$database->escapeString($color).'\'';

Theoretically, the above solution should work. If not, then probably the installation must be checked. (as dbs wrote)

dbs:
Manu is right.
But i also on strict and my install of bookings was new today. No problems.
Ruman has also problems with code2 and i'm sure with other things too.
So i think the install of wb was not right. Missing files after FTP transfer maybe.

rumen:
It is installed on the XAMPP - local server for now. I will transfer it to the host in 1-2 days when I finish to configure modules.

With Code 2 I have never had problem in the past. First time is today. Usually got problems with languages (Cyrillic) and many times with lightbox ... just like now again. Missing controls in Minigal 2. And this time I have only one jQuery.

I refreshed the data base. Changed the codes as per the instructions above and now I was able to create the groups, but again same error when save data input in the module.   

rumen:
I have just upload the site to the host. Code2 works perfect now. All calendars were down. I spoke with the host and they fixed one. From all calendars only one ("My calendar") works but it is enough. Booking and Registration Manager couldn't run. My Calendar - the issue was in the host "Mod_security" was enabled. They added the rules for the site and My Calendar works now.

The issue with JQuiry unfortunately remains. Controls still missing in Mini Gallery 2.x   

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version