WebsiteBaker Support (2.12.x) > Modules

OFA - Duplicate Item / Issue in MySQL-Strict Mode

(1/1)

Gast:
damit man es auch wieder findet

der Vorgang "Item duplizieren" erzeugt unter MYSQL-Strict Mode auf Grund einer unvollständigen Anweisung keinen Insert.
Zur Behebung in Datei save_item.php  ~ Zeile 603 diesen Original-Code

engl Translation
The "Duplicate Item" operation does not create an insert under MYSQL-Strict Mode due to an incomplete statement.
To fix in file save_item.php ~ line 603 this original code


--- Code: ---// Insert new row into database
$database->query('INSERT INTO `'.TABLE_PREFIX.'mod_'.$mod_name.'_items` (`section_id`, `page_id`, `position`) VALUES ('.(int)$section_id.', '.(int)$page_id.', '.(int)$position.')');
--- End code ---

ersetzen durch / replace with

--- Code: ---// Insert new row into database
    $sql = 'INSERT INTO `'.TABLE_PREFIX.'mod_'.$mod_name.'_items` SET '
      .   '`section_id` = '.(int)$section_id.', '
      .   '`page_id` = '.(int)$page_id.', '
      .   '`title` = \'\', '
      .   '`link` = \'\', '
      .   '`description` = \'\', '
      .   '`position` = '.(int)$position.', '
      .   '`scheduling` = \'\', '
      .   '`main_image` = \'\', '
      .   '`modified_when` = \''.time().'\', '
      .   '`modified_by` = '.(int)$admin->get_user_id().' ';
   
    // Check if there was a db error
    if (!$database->query($sql)){
      $admin->print_error($database->get_error());
    }
--- End code ---

Navigation

[0] Message Index

Go to full version