Vous n'êtes pas identifié(e).
13 février 2024 Sortie de Dotclear 2.29
Pages : 1
tentative d'import, php 7.2, base sqlite, que ce soit un "Blog simple" ou bien "Tous les blogs" j'ai :
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /home/***/public_html/dotclear2-14-dev/dotclear/inc/core/class.dc.error.php on line 112
Call Stack
# Time Memory Function Location
1 0.0000 401032 {main}( ) .../plugin.php:0
2 0.1026 1314240 include( '/home/***/public_html/dotclear2-14-dev/dotclear/plugins/importExport/index.php' ) .../plugin.php:42
3 0.1125 1419288 dcPage::notices( ) .../index.php:78
4 0.1125 1419768 dcError->toHTML( ) .../lib.dc.page.php:281
et
Erreur :
near "TRUNCATE": syntax error (1)
Dernière modification par adjaya (2018-04-05 21:14:55)
Photo, Art et Création Numérique : http://benoit-grelier.photo7.fr/
Hors ligne
Ah oui effectivement, je viens de pousser une correction pour le bug, une parenthèse au mauvais endroit, )
warning resolu, merci.
sans présumer du problème d'import (TRUNCATE)
reste donc l'erreur qui fait echouer l'import:
Erreur : near "TRUNCATE": syntax error (1)
Pour l'instant je ne vois pas ce qui cloche, est-ce un bug lié à la database utilisée (sqlite)?
Quelqu'un a-t-il essayé un import avec mysql? Au cas ou, un retour serait apprécié, afin d'affiner mon investigation...
EDIT:
Je trouve peut-être un début d'explication ici: https://www.tutorialspoint.com/sqlite/s … _table.htm
Unfortunately, we do not have TRUNCATE TABLE command in SQLite but you can use SQLite DELETE command to delete complete data from an existing table, though it is recommended to use DROP TABLE command to drop the complete table and re-create it once again.
mais aussi ici: https://www.techonthenet.com/sqlite/truncate.php
The syntax to truncate a table in SQLite (using the TRUNCATE optimizer) is:
DELETE FROM table_name;
Mais aussi
Note
SQLite can only use the TRUNCATE optimizer if the table (to truncate) does not have any triggers.
Reste à voir ce qui a été changé dans la procédure d'import et depuis quand, et qui provoque ce bug, vu que cela marchait pour moi jusqu'à présent.
Dernière modification par adjaya (2018-04-08 17:25:43)
Photo, Art et Création Numérique : http://benoit-grelier.photo7.fr/
Hors ligne
Bon, après recherche dans le code, il y a deux fonction ou je trouve "TRUNCATE" :
Dans inc/core/class.dc.log.php ligne 146
public function delLogs($id, $all = false)
{
$strReq = $all ?
'TRUNCATE TABLE ' . $this->prefix . 'log' :
'DELETE FROM ' . $this->prefix . 'log WHERE log_id' . $this->core->con->in($id);
$this->core->con->execute($strReq);
}
Et dans plugin/menu/_admin.php ligne 59
# importInit behavior
public static function importInit($bk,$core)
{
$strReq =
'TRUNCATE TABLE '.$core->prefix.'menu';
$core->con->execute($strReq);
$bk->cur_menu = $core->con->openCursor($core->prefix.'menu');
}
Je pense que pour l'import avec sqlite, le bug vient de cette deuxième methode ( importInit($bk,$core )
et la méthode delLogs($id, $all = false) est aussi incompatible avec la syntaxe sql de sqlite.
EDIT: après désactivation du plugin Menu, l'import se passe sans problème, c'est donc bien lui le fautif!
Reste à voir avec function delLogs($id, $all = false) et sqlite, je regarde cela dès que possible.
Dernière modification par adjaya (2018-04-08 08:57:12)
Photo, Art et Création Numérique : http://benoit-grelier.photo7.fr/
Hors ligne
Pages : 1
Vous n'êtes pas identifié(e).