Overview
Comment: | Fix: colonne menu_condition non existante lorsqu'on restaure un plugin après restauration DB ancienne |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | stable |
Files: | files | file ages | folders |
SHA1: |
b9274fb4121a7528c09cacd06ed61dd2 |
User & Date: | bohwaz on 2018-12-20 11:37:42 |
Other Links: | manifest | tags |
Context
2018-12-24
| ||
16:36 | Changement dénomination champ privé check-in: ebc410d846 user: bohwaz tags: trunk, stable | |
2018-12-20
| ||
11:37 | Fix: colonne menu_condition non existante lorsqu'on restaure un plugin après restauration DB ancienne check-in: b9274fb412 user: bohwaz tags: trunk, stable | |
2018-12-18
| ||
15:04 | Corriger bug lorsque le compte n'existe plus check-in: aae43faabd user: bohwaz tags: trunk, stable | |
Changes
Modified src/include/lib/Garradin/Plugin.php from [57a57cdb9d] to [44775e077d].
︙ | ︙ | |||
288 289 290 291 292 293 294 | { $plugin = $this; include $this->path() . '/upgrade.php'; } $infos = (object) parse_ini_file($this->path() . '/garradin_plugin.ini', false); | | > > > > | > > | | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | { $plugin = $this; include $this->path() . '/upgrade.php'; } $infos = (object) parse_ini_file($this->path() . '/garradin_plugin.ini', false); $data = [ 'nom' => $infos->nom, 'description'=> $infos->description, 'auteur' => $infos->auteur, 'url' => $infos->url, 'version' => $infos->version, 'menu' => (int)(bool)$infos->menu, ]; if ($infos->menu && !empty($infos->menu_condition)) { $data['menu_condition'] = trim($infos->menu_condition); } return DB::getInstance()->update('plugins', $data, 'id = :id', ['id' => $this->id]); } /** * Associer un signal à un callback du plugin * @param string $signal Nom du signal (par exemple boucle.agenda pour la boucle de type AGENDA) * @param mixed $callback Callback, sous forme d'un nom de fonction ou de méthode statique * @return boolean TRUE |
︙ | ︙ | |||
693 694 695 696 697 698 699 | { throw new \RuntimeException('config.json invalide. Code erreur JSON: ' . json_last_error()); } $config = json_encode($config); } | | < < < | > > > > > > > > > | 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | { throw new \RuntimeException('config.json invalide. Code erreur JSON: ' . json_last_error()); } $config = json_encode($config); } $data = [ 'id' => $id, 'officiel' => (int)(bool)$official, 'nom' => $infos->nom, 'description'=> $infos->description, 'auteur' => $infos->auteur, 'url' => $infos->url, 'version' => $infos->version, 'menu' => (int)(bool)$infos->menu, 'config' => $config, ]; if ($infos->menu && !empty($infos->menu_condition)) { $data['menu_condition'] = trim($infos->menu_condition); } $db = DB::getInstance(); $db->begin(); $db->insert('plugins', $data); if (file_exists($path . '/install.php')) { $plugin = new Plugin($id); require $plugin->path() . '/install.php'; } |
︙ | ︙ |