Anomalie #1138
ferméImpossible de supprimer un champ dynamique
0%
Description
J'ai créé un champ dynamique de type bool dans la version de galette 0.8.3(?) appelé "Renonciation".
Champ finalement inutile, mais je n'arrive pas à le supprimer.
La version 0.9 de galette n'arrive pas à le supprimer non plus.
J'ai bien tenté d'afficher les logs...mais je n'ai aucun autre message que le grand rectangle rouge.
Fichiers
Mis à jour par Thierry Mouchaud il y a presque 7 ans
Pour obtenir les 4 messages d'erreur, j'ai juste continué à cliquer sur "Supprimer" dans la boîte de dialogue qui persiste à s'afficher...et puis j'ai cliqué sur "Annuler".
Mis à jour par Johan Cwiklinski il y a presque 7 ans
Un message d'erreur devrait normalement être affiché, dans le log de Galette normalement.
Il est également possible d'effectuer la modification suivante :
diff --git a/galette/lib/Galette/DynamicFieldsTypes/DynamicFieldType.php b/galette/lib/Galette/DynamicFieldsTypes/DynamicFieldType.php
index 825ecaf0..c8fcf7cb 100644
--- a/galette/lib/Galette/DynamicFieldsTypes/DynamicFieldType.php
+++ b/galette/lib/Galette/DynamicFieldsTypes/DynamicFieldType.php
@@ -1023,6 +1023,7 @@ abstract class DynamicFieldType
$this->zdb->connection->commit();
return true;
} catch (\Exception $e) {
+ throw $e;
$this->zdb->connection->rollBack();
Analog::log(
'An error occured deleting field | ' . $e->getMessage(),
Mis à jour par Johan Cwiklinski il y a plus de 6 ans
- Statut changé de Nouveau à Rejeté
Soit le souci a déjà été réglé pour la future 0.9.1, soit je ne parviens pas à reproduire.
Pas de retour suite à mon commentaire ; je ferme ce ticket.
Mis à jour par Thierry Mouchaud il y a plus de 6 ans
Galette version 0.9.1.2 , le throw $e;
est déjà là.
J'ai donc cliqué sur "Supprimer" dans l'interface web, ce qui m'a amené le même message de Galette : "Une erreur est survenue".
A partir de cette action voici les extraits de logs correspondants (timestamp + action) (les fichiers de log ont été recréés juste avant l'action dans Galette)
Le log galette_run.log :
178.33.103.27 - 2018-07-22 22:17:50 - 4 - Plugin galette-plugin-objectslend is missing a _define.php and/or _routes.php files that are required.
178.33.103.27 - 2018-07-22 22:17:50 - 4 - Plugin galette-plugin-objectslend is missing a _define.php and/or _routes.php files that are required.
178.33.103.27 - 2018-07-22 22:17:51 - 4 - Plugin galette-plugin-objectslend is missing a _define.php and/or _routes.php files that are required.
178.33.103.27 - 2018-07-22 22:17:52 - 4 - Plugin galette-plugin-objectslend is missing a _define.php and/or _routes.php files that are required.
178.33.103.27 - 2018-07-22 22:17:52 - 3 - Query error: DELETE FROM `galette_field_types` WHERE `field_id` = '1' AND `field_form` = 'adh' exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`echosolutions`.`galette_dynamic_fields`, CONSTRAINT `galette_dynamic_fields_ibfk_1` FOREIGN KEY (`field_id`) REFERENCES `galette_field_types` (`field_id`))' in /home/echosolu/galette.ethiqueetchiens.fr/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Connection.php:379
Stack trace:
#0 /home/echosolu/galette.ethiqueetchiens.fr/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Connection.php(379): PDO->query('DELETE FROM `ga...')
#1 /home/echosolu/galette.ethiqueetchiens.fr/vendor/zendframework/zend-db/src/Adapter/Adapter.php(205): Zend\Db\Adapter\Driver\Pdo\Connection->execute('DELETE FROM `ga...')
#2 /home/echosolu/galette.ethiqueetchiens.fr/lib/Galette/Core/Db.php(778): Zend\Db\Adapter\Adapter->query('DELETE FROM `ga...', 'execute')
#3 /home/echosolu/galette.ethiqueetchiens.fr/lib/Galette/DynamicFields/DynamicField.php(1009): Galette\Core\Db->execute(Object(Zend\Db\Sql\Delete))
#4 /home/echosolu/galette.ethiqueetchiens.fr/includes/routes/management.routes.php(2967): Galette\DynamicFields\DynamicField->remove()
#5 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#6 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#7 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/Route.php(335): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#8 /home/echosolu/galette.ethiqueetchiens.fr/includes/main.inc.php(236): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#9 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#10 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)
#11 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#12 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#13 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#14 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/Route.php(313): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#15 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/App.php(495): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#16 /home/echosolu/galette.ethiqueetchiens.fr/vendor/akrabat/rka-slim-session-middleware/RKA/SessionMiddleware.php(47): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#17 [internal function]: RKA\SessionMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#18 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(RKA\SessionMiddleware), Array)
#19 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#20 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#21 /home/echosolu/galette.ethiqueetchiens.fr/includes/main.inc.php(370): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#22 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#23 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)
#24 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#25 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#26 /home/echosolu/galette.ethiqueetchiens.fr/includes/main.inc.php(395): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#27 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#28 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)
#29 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#30 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#31 /home/echosolu/galette.ethiqueetchiens.fr/includes/main.inc.php(452): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#32 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#33 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)
#34 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#35 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#36 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#37 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/App.php(388): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#38 /home/echosolu/galette.ethiqueetchiens.fr/vendor/slim/slim/Slim/App.php(296): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#39 /home/echosolu/galette.ethiqueetchiens.fr/includes/main.inc.php(465): Slim\App->run()
#40 /home/echosolu/galette.ethiqueetchiens.fr/webroot/index.php(44): require_once('/home/echosolu/...')
#41 {main}
178.33.103.27 - 2018-07-22 22:17:52 - 3 - An error occured deleting field | SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`echosolutions`.`galette_dynamic_fields`, CONSTRAINT `galette_dynamic_fields_ibfk_1` FOREIGN KEY (`field_id`) REFERENCES `galette_field_types` (`field_id`))
178.33.103.27 - 2018-07-22 22:17:52 - 4 - Plugin galette-plugin-objectslend is missing a _define.php and/or _routes.php files that are required.
178.33.103.27 - 2018-07-22 22:17:52 - 4 - Plugin galette-plugin-objectslend is missing a _define.php and/or _routes.php files that are required.
Le log galette_debug.log:
178.33.103.27 - 2018-07-22 22:17:50 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_database`.`version` AS `version` FROM `galette_database` LIMIT 1
178.33.103.27 - 2018-07-22 22:17:50 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:50 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT DISTINCT `galette_statuts`.`id_statut` AS `id_statut`, `galette_statuts`.`libelle_statut` AS `libelle_statut`, `galette_statuts`.`priorite_statut` AS `priorite_statut` FROM `galette_statuts` ORDER BY `priorite_statut` ASC
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Membre du Collège' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Membre honoraire' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Chien - Rattaché à un membre' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = '/history/filter' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_field_types`.* FROM `galette_field_types` WHERE field_id = 1
178.33.103.27 - 2018-07-22 22:17:50 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Renonciation' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:51 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:51 - 7 - Executing query: SELECT `galette_database`.`version` AS `version` FROM `galette_database` LIMIT 1
178.33.103.27 - 2018-07-22 22:17:51 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:51 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT DISTINCT `galette_statuts`.`id_statut` AS `id_statut`, `galette_statuts`.`libelle_statut` AS `libelle_statut`, `galette_statuts`.`priorite_statut` AS `priorite_statut` FROM `galette_statuts` ORDER BY `priorite_statut` ASC
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Membre du Collège' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Membre honoraire' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Chien - Rattaché à un membre' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = '/history/filter' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_field_types`.* FROM `galette_field_types` WHERE field_id = 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: UPDATE `galette_field_types` SET `field_index` = field_index-1 WHERE `field_index` > '11' AND `field_form` = 'adh'
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: DELETE FROM `galette_dynamic_fields` WHERE `field_id` = '1' AND `field_form` = 'adh'
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: DELETE FROM `galette_field_types` WHERE `field_id` = '1' AND `field_form` = 'adh'
178.33.103.27 - 2018-07-22 22:17:52 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_database`.`version` AS `version` FROM `galette_database` LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:52 - 7 - [Db] Database connection was successfull!
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT DISTINCT `galette_statuts`.`id_statut` AS `id_statut`, `galette_statuts`.`libelle_statut` AS `libelle_statut`, `galette_statuts`.`priorite_statut` AS `priorite_statut` FROM `galette_statuts` ORDER BY `priorite_statut` ASC
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Membre du Collège' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Membre honoraire' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = 'Chien - Rattaché à un membre' AND `text_locale` = 'fr_FR.utf8' LIMIT 1
178.33.103.27 - 2018-07-22 22:17:52 - 7 - Executing query: SELECT `galette_l10n`.`text_trans` AS `text_trans` FROM `galette_l10n` WHERE `text_orig` = '/history/filter' AND `text_locale` = 'fr_FR.utf8' LIMIT 1