Booking 2.x error in DB table

dbs

The box with red border is for messages. I think it's a mistake in design, should not be visibale all the time.

There is a file save.php which i can't understand. It will update a table mod_bookings. But this table is not created by install.php. So i don't know what here will be saved and where.

But the module works for me.



[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Lines commented



But got "Invalid parameter" when saving new entry.



I think something can there be a difference between the settings of the server hour:min   and the module?

And this one:


DarkViper

#19
too much complicated at all... ;)

simply delete the whoole part:
---------
// workaround for PHP4 --- known to work with 4.4.9
if ( ! function_exists('date_parse') ) {

[...]
    );
}

---------
This section is definitely not needed anymore since WB no longer works with PHP-4.
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

dbs

Seems also not work for you, because no answer.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

dbs

This is the reason for your message with T_STRING.
I attache my module.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Does the other lines for "date" have also backslash?

My 42 to 52 lines looks like:

if ( ! function_exists('date_parse') ) {

    $eval_func =
    'function date_parse ( $date ) {
        $date_array = getdate(strtotime($date));
        $date_array['day']    = $date_array['mday'];
        $date_array['month']  = $date_array['mon'];
        $date_array['hour']   = $date_array['hours'];
        $date_array['minute'] = $date_array['minutes'];
        $date_array['second'] = $date_array['seconds'];
        return $date_array;

dbs

Strange. My line 47 looks so:        $date_array[\'day\']    = $date_array[\'mday\'];
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Now gave the error (after changes of the function line 3032):

The error:
There was an uncatched exception
syntax error, unexpected 'day' (T_STRING)
in line (47) of (/modules/bookings_v2/functions.php):



The line 47:
$date_array['day']    = $date_array['mday'];



dbs

If you have a errorlog message "each is deprecated". Try this in functions.php line 3039.

Replace
while ( list ( $index, $item ) = each ( $booked ) )

withforeach ( $booked as $index => $item )
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

dbs

Have tried the same entry like yours, also in front- and backend language BG. :-)It works.



PHP7.3.11, Firefox, Bootstrap3, jQuery 3.3.1
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Well. No error messages and again no any success with "booking"

Here is the module with entry:


Here is the entry:


And here is the result ... nothing

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   

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.   

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.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

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)
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

dbs

Yes, sounds like install problems.
You could upload all files again and then make a "upgrade" via i-button in the top menu.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Maybe there is any problem with the installation. Code2 also doesn't work. Whatever you put inside after save there is empty box. Registration 4 even give error too: Error!: could not find driver

This is what I get whatever I try to enter in Booking:



I put last WB 2.12.2 Stable. PHP 7.3

dbs

New entry or new group is no problem here.
Except if i go into a entry, there is a red bordered box on the top, but without content.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Hello,

When I try to make new entry (never mind a group or just a simple entry) I got same error:

Incorrect integer value: '' for column `relax`.`wb_mod_bookings_groups`.`group_id` at row 1

That's all. Front end - Nothing, Back End the error above.

Regards,

dbs

Hi, there is nothing with "relax" in the module, so far i see.What have you tried, how can i reproduce the error?
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Hi there,
I try to run module Booking, but I got strange error

Incorrect integer value: '' for column `relax`.`wb_mod_bookings_groups`.`group_id` at row 1

And I really can't get what is wrong here:



Thanks in advance!

Regards,