Erreur d'install [Réglé]
MrToine Membre non connecté
Booster Bazooka
- Booster Bazooka
- Voir le profil du membre MrToine
- Inscrit le : 26/10/2014
- Groupes :
Je suis peut etre aveugle, ou inattentif ou bien même les deux... N'empêche que je ne trouve pas ce qui ne va pas. J'ai une erreur :
Une erreur s'est produite lors de l'opération
Je vous laisse mon code d'installation pour essayer de m'aider :
Code PHP :
<?php class PartnersSetup extends DefaultModuleSetup { public static $partners_table; public static $partners_config_table; public static $partners_news_table; private $partner; public static function __static(){ self::$partners_table = PREFIX . 'partners'; self::$partners_config_table = PREFIX . 'partners_config'; self::$partners_news_table = PREFIX . 'partners_news'; } public function install(){ $this->create_tables(); //$this->insert_data(); } public function uninstall(){ $this->drop_tables(); } public function drop_tables(){ PersistenceContext::get_dbms_utils()->drop(self::$partners_table); PersistenceContext::get_dbms_utils()->drop(self::$partners_config_table); PersistenceContext::get_dbms_utils()->drop(self::$partners_news_table); } public function create_tables(){ $partners_fields = array( 'id' => array( 'type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1 ), 'user_id' => array( 'type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1, 'default' => 0 ), 'name' => array( 'type' => 'string', 'length' => 250, 'notnull' => 1 ), 'mail' => array( 'type' => 'string', 'lenght' => 250, 'notnull' => 1 ), 'password' => array( 'type' => 'string', 'lenght' => 250, 'notnull' => 1 ), 'description' => array( 'type' => 'text', 'length' => 65000 ), 'link' => array( 'type' => 'string', 'length' => 250, 'notnull' => 1 ), 'link_banner' => array( 'type' => 'string', 'length' => 250, 'notnull' => 1 ), 'entries' => array( 'type' => 'integer', 'lenght' => 11, 'notnull' => 1, 'default' => 0 ), 'outputs' => array( 'type' => 'integer', 'lenght' => 11, 'notnull' => 1, 'default' => 0 ), 'ip_adress' => array( 'type' => 'string', 'lenght' => 10, 'notnull' => 1 ) ); $partners_options = array( 'primary' => array('id'), 'indexes' => array( 'user_id' => array( 'type' => 'key', 'fields' => 'user_id' ), 'name' => array( 'type' => 'fulltext', 'fields' => 'name' ), 'mail' => array( 'type' => 'fulltext', 'fields' => 'mail' ), 'password' => array( 'type' => 'fulltext', 'fields' => 'password' ), 'description' => array( 'type' => 'fulltext', 'fields' => 'description' ), 'link' => array( 'type' => 'fulltext', 'fields' => 'link' ), 'link_banner' => array( 'type' => 'fulltext', 'fields' => 'link_banner' ), ) ); $news_fields = array( 'id' => array( 'type' => 'integer', 'lenght' => 11, 'autoincrement' => true, 'notnull' => 1 ), 'user_id' => array( 'type' => 'integer', 'lenght' => 11, 'notnull' => 1, 'default' => 0 ), 'title' => array( 'type' => 'string', 'lenght' => 255, 'notnull' => 1 ), 'content' => array( 'type' => 'string', 'lenght' => 65000 ), 'created' => array( 'type' => 'integer', 'lenght' => 11, 'notnull' => 1 ), 'edited' => array( 'type' => 'integer', 'lenght' => 11, 'notnull' => 1 ) ); $news_options = array( 'primary' => array('id'), 'indexes' => array( 'user_id' => array( 'type' => 'key', 'fields'=> 'user_id' ), 'title' => array( 'type' => 'fulltext', 'fields' => 'title' ), 'content' => array( 'type' => 'fulltext', 'fields' => 'content' ) ) ); $config_fields = array( 'nb_partners_mini_module' => array( 'type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 5 ), 'display_rank' => array( 'type' => 'string', 'length' => 3, 'notnull' => 1 ), 'partner_manager' => array( 'type' => 'string', 'length' => 3, 'notnull' => 1 ), 'news_manager' => array( 'type' => 'string', 'length' => 3, 'notnull' => 1 ), ); $config_options = array( 'indexes' => array( 'display_rank' => array('type' => 'fulltext', 'fields' => 'display_rank'), 'partner_manager' => array('type' => 'fulltext', 'fields' => 'partner_manager'), 'news_manager' => array('type' => 'fulltext', 'fields' => 'news_manager'), ), ); PersistenceContext::get_dbms_utils()->create_table(self::$partners_table, $partners_fields, $partners_options); PersistenceContext::get_dbms_utils()->create_table(self::$partners_config_table, $config_fields, $config_options); PersistenceContext::get_dbms_utils()->create_table(self::$partners_news_table, $news_fields, $news_options); } private function insert_data(){ $this->partner = LangLoader::get('install', 'partners'); $this->insert_partners_data(); } public function insert_partners_data(){ PersistenceContext::get_querier()->insert(self::$partners_table, array( 'id' => 1, 'user_id' => 1, 'mail' => "$this->partner['partner.mail']", 'password' => "$this->partner['partner.name']", 'name' => "$this->partner['partner.name']", 'description' => "$this->partner['partner.description']", 'link' => "$this->partner['partner.link']", 'link_banner' => "$this->partner['partner.link_banner']", 'ip_adress' => "NULL" )); PersistenceContext::get_querier()->insert(self::$partners_config_table, array( 'nb_partners_mini_module' => 5, 'display_rank' => "Oui", 'partner_manager' => "Oui", 'news_manager' => "Oui" )); } }
janus57 Membre non connecté
- Booster Fusée
- Voir le profil du membre janus57
- Inscrit le : 07/12/2007
- Groupes :
- Equipe Assistance
et dans les erreurs archivés / logs il y a quoi ?
Cordialement, janus57
MrToine Membre non connecté
Booster Bazooka
- Booster Bazooka
- Voir le profil du membre MrToine
- Inscrit le : 26/10/2014
- Groupes :
Fatale : invalid query. (ERRNO 1067) Invalid default value for 'user_id'query: CREATE TABLE phpboost_partners (`id` INT(11) AUTO_INCREMENT NOT NULL, `user_id` INT(11) AUTO_INCREMENT DEFAULT 0 NOT NULL, `name` VARCHAR(250) NOT NULL, `mail` VARCHAR(255) NOT NULL, `password` VARCHAR(255) NOT NULL, `description` TEXT DEFAULT NULL, `link` VARCHAR(250) NOT NULL, `link_banner` VARCHAR(250) NOT NULL, `entries` INT DEFAULT 0 NOT NULL, `outputs` INT DEFAULT 0 NOT NULL, `ip_adress` VARCHAR(255) NOT NULL, KEY `user_id` (`user_id`), FULLTEXT KEY `name` (`name`), FULLTEXT KEY `mail` (`mail`), FULLTEXT KEY `password` (`password`), FULLTEXT KEY `description` (`description`), FULLTEXT KEY `link` (`link`), FULLTEXT KEY `link_banner` (`link_banner`), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci ENGINE = MyISAM
janus57 Membre non connecté
- Booster Fusée
- Voir le profil du membre janus57
- Inscrit le : 07/12/2007
- Groupes :
- Equipe Assistance
visiblement mauvais paramètre au niveau du champ "user_id" (qui ce qui semble normal que que c'est pas possible d'avoir un auto-increment avec une valeur par défaut à 0).
Cordialement, janus57
MrToine Membre non connecté
Booster Bazooka
- Booster Bazooka
- Voir le profil du membre MrToine
- Inscrit le : 26/10/2014
- Groupes :
Code PHP :
'user_id' => array('type' => 'integer', 'lenght' => 11, 'notnull' => 1, 'default' => 0),
janus57 Membre non connecté
- Booster Fusée
- Voir le profil du membre janus57
- Inscrit le : 07/12/2007
- Groupes :
- Equipe Assistance
euh désolé mais dans le code que tu as posté :
Code PHP :
'user_id' => array( 'type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1, 'default' => 0 ),
il est bien en autoincrement, tout comme dans le message d'erreur :
Citation :
`user_id` INT(11) AUTO_INCREMENT DEFAULT 0 NOT NULL
Cordialement, janus57
MrToine Membre non connecté
Booster Bazooka
- Booster Bazooka
- Voir le profil du membre MrToine
- Inscrit le : 26/10/2014
- Groupes :
MrToine Membre non connecté
Booster Bazooka
- Booster Bazooka
- Voir le profil du membre MrToine
- Inscrit le : 26/10/2014
- Groupes :
Je viens d'obtenir une nouvelle erreur, mais vu le nombre conséquent de fichiers (+/-50 je sais pas trop ou je dois chercher pour la corriger.. :/
Fatale : syntax error, unexpected '"', expecting ')'
[0] /kernel/framework/core/ClassLoader.class.php:63 - ClassLoader::inc(string)
[1] Internal: - ClassLoader::autoload(string)
[2] /partners/services/PartnersService.class.php:59 - spl_autoload_call(string)
[3] /partners/controllers/AdminPartnersConfigController.class.php:138 - PartnersService::get_config()
[4] /partners/controllers/AdminPartnersConfigController.class.php:80 - AdminPartnersConfigController->get_config()
[5] /partners/controllers/AdminPartnersConfigController.class.php:40 - AdminPartnersConfigController->build_form()
[6] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:87 - AdminPartnersConfigController->execute(HTTPRequestCustom)
[7] /kernel/framework/mvc/dispatcher/UrlControllerMapper.class.php:59 - UrlControllerMapper->do_call()
[8] /kernel/framework/mvc/dispatcher/Dispatcher.class.php:67 - UrlControllerMapper->call()
[9] /kernel/framework/mvc/dispatcher/DispatchManager.class.php:43 - Dispatcher->dispatch()
[10] /partners/index.php:48 - DispatchManager::dispatch(array)
[URL] /phpboost/partners/admin/config
janus57 Membre non connecté
- Booster Fusée
- Voir le profil du membre janus57
- Inscrit le : 07/12/2007
- Groupes :
- Equipe Assistance
vu la stacktrace l'erreur doit être dans "PartnersService.class.php" ou un fichier appelé par "PartnersService.class.php" (comme AdminPartnersConfigController.class.php ?)
Cordialement, janus57
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie