Overview
Comment: | Oubli d'un champ dans la table rappel_envoyes, créant une erreur lors de la suppression de rappels, voici le patch qui corrige, merci à Nicolas pour le signalement. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cf1e84cda451c0c501d0e9fe49d7cb89 |
User & Date: | bohwaz on 2015-10-10 08:00:36 |
Other Links: | manifest | tags |
Context
2015-10-10
| ||
08:11 | Eviter une erreur de clé non unique dupliquée à cause d'un duplicata de hash, quand le formulaire javascript ne marche pas ça peut arriver, signalé par Terry. check-in: c020f63920 user: bohwaz tags: trunk | |
08:00 | Oubli d'un champ dans la table rappel_envoyes, créant une erreur lors de la suppression de rappels, voici le patch qui corrige, merci à Nicolas pour le signalement. check-in: cf1e84cda4 user: bohwaz tags: trunk | |
2015-09-09
| ||
04:53 | Correction IDs champs mot de passe, fix ticket bd936b31a3232467c0278d76a537051683d7a6ce check-in: 8e141dc34f user: bohwaz tags: trunk | |
Changes
Added src/include/data/0.7.2.sql version [4b77ea5e4d].
> | 1 | ALTER TABLE rappels_envoyes ADD COLUMN id_rappel INTEGER NULL REFERENCES rappels (id); |
Modified src/include/data/schema.sql from [4641781372] to [255336d2fc].
︙ | ︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | CREATE TABLE rappels_envoyes -- Enregistrement des rappels envoyés à qui et quand ( id INTEGER PRIMARY KEY, id_membre INTEGER NOT NULL REFERENCES membres (id), id_cotisation INTEGER NOT NULL REFERENCES cotisations (id), date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, media INTEGER NOT NULL -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre ); -- | > | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | CREATE TABLE rappels_envoyes -- Enregistrement des rappels envoyés à qui et quand ( id INTEGER PRIMARY KEY, id_membre INTEGER NOT NULL REFERENCES membres (id), id_cotisation INTEGER NOT NULL REFERENCES cotisations (id), id_rappel INTEGER NULL REFERENCES rappels (id), date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, media INTEGER NOT NULL -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre ); -- |
︙ | ︙ |
Modified src/include/lib/Garradin/Rappels.php from [b2fca7b211] to [a07b8f1b57].
︙ | ︙ | |||
161 162 163 164 165 166 167 | SELECT *, /* Nombre de jours avant ou après expiration */ (julianday(date()) - julianday(expiration)) AS nb_jours, /* Date de mise en œuvre du rappel */ date(expiration, delai || \' days\') AS date_rappel FROM ( | | | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | SELECT *, /* Nombre de jours avant ou après expiration */ (julianday(date()) - julianday(expiration)) AS nb_jours, /* Date de mise en œuvre du rappel */ date(expiration, delai || \' days\') AS date_rappel FROM ( SELECT m.*, r.delai, r.sujet, r.texte, r.id_cotisation, r.id AS id_rappel, m.'.$config->get('champ_identite').' AS identite, CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') WHEN c.fin IS NOT NULL THEN c.fin ELSE 0 END AS expiration FROM rappels AS r INNER JOIN cotisations AS c ON c.id = r.id_cotisation INNER JOIN cotisations_membres AS cm ON cm.id_cotisation = c.id INNER JOIN membres AS m ON m.id = cm.id_membre |
︙ | ︙ |
Modified src/include/lib/Garradin/Rappels_Envoyes.php from [6ec98d77c5] to [fa5f4d17da].
︙ | ︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | * Vérification des champs fournis pour la modification de donnée * @param array $data Tableau contenant les champs à ajouter/modifier * @return void */ protected function _checkFields(&$data) { $db = DB::getInstance(); if (isset($data['id_cotisation'])) { if (!$db->simpleQuerySingle('SELECT 1 FROM cotisations WHERE id = ?;', false, (int) $data['id_cotisation'])) { throw new UserException('Cotisation inconnue.'); } | > > > > > | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | * Vérification des champs fournis pour la modification de donnée * @param array $data Tableau contenant les champs à ajouter/modifier * @return void */ protected function _checkFields(&$data) { $db = DB::getInstance(); if (empty($data['id_rappel']) || !$db->simpleQuerySingle('SELECT 1 FROM rappels WHERE id = ?;', false, (int) $data['id_rappel'])) { throw new \LogicException('ID rappel non fourni ou inexistant dans la table rappels'); } if (isset($data['id_cotisation'])) { if (!$db->simpleQuerySingle('SELECT 1 FROM cotisations WHERE id = ?;', false, (int) $data['id_cotisation'])) { throw new UserException('Cotisation inconnue.'); } |
︙ | ︙ | |||
146 147 148 149 150 151 152 153 154 155 156 157 158 159 | // Envoi du mail Utils::mail($data['email'], $subject, $text); // Enregistrement en DB $this->add([ 'id_cotisation' => $data['id_cotisation'], 'id_membre' => $data['id'], 'media' => Rappels_Envoyes::MEDIA_EMAIL, // On enregistre la date de mise en œuvre du rappel // et non pas la date d'envoi effective du rappel // car l'envoi du rappel peut ne pas être effectué // le jour où il aurait dû être envoyé (la magie des cron) 'date' => $data['date_rappel'], ]); | > | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | // Envoi du mail Utils::mail($data['email'], $subject, $text); // Enregistrement en DB $this->add([ 'id_cotisation' => $data['id_cotisation'], 'id_membre' => $data['id'], 'id_rappel' => $data['id_rappel'], 'media' => Rappels_Envoyes::MEDIA_EMAIL, // On enregistre la date de mise en œuvre du rappel // et non pas la date d'envoi effective du rappel // car l'envoi du rappel peut ne pas être effectué // le jour où il aurait dû être envoyé (la magie des cron) 'date' => $data['date_rappel'], ]); |
︙ | ︙ |
Modified src/www/admin/upgrade.php from [31d46ac130] to [83e841c503].
︙ | ︙ | |||
227 228 229 230 231 232 233 234 235 236 237 238 239 240 | 'id_auteur' => null, 'contenu' => $content, 'modification' => 'Mise à jour 0.7.0 (transformation SPIP vers SkrivML)', ]); } } $db->exec('END;'); } Utils::clearCaches(); $config->setVersion(garradin_version()); | > > > > > > > > > > | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | 'id_auteur' => null, 'contenu' => $content, 'modification' => 'Mise à jour 0.7.0 (transformation SPIP vers SkrivML)', ]); } } $db->exec('END;'); } if (version_compare($v, '0.7.2', '<')) { $db->exec('PRAGMA foreign_keys = OFF; BEGIN;'); // Mise à jour base de données $db->exec(file_get_contents(ROOT . '/include/data/0.7.2.sql')); $db->exec('END;'); } Utils::clearCaches(); $config->setVersion(garradin_version()); |
︙ | ︙ |