Author Topic: OFA - Duplicate Item / Issue in MySQL-Strict Mode  (Read 1452 times)

Offline jacobi22

  • Posts: 5891
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
OFA - Duplicate Item / Issue in MySQL-Strict Mode
« on: June 04, 2019, 12:02:22 PM »
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: [Select]
// 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.')');

ersetzen durch / replace with
Code: [Select]
// 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());
    }
Wer nicht will, findet Gründe, wer will, findet Wege.

 

postern-length