update : save version when save config

This commit is contained in:
Fred Tempez 2021-04-01 17:15:05 +02:00
parent 90d0fc2127
commit 7f4e03f2c6
3 changed files with 8 additions and 5 deletions

View File

@ -407,7 +407,8 @@ class blog extends common {
$this->setData(['module', $this->getUrl(0), 'config',[
'feeds' => $this->getInput('blogConfigShowFeeds',helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('blogConfigFeedslabel',helper::FILTER_STRING_SHORT),
'itemsperPage' => $this->getInput('blogConfigItemsperPage', helper::FILTER_INT,true)
'itemsperPage' => $this->getInput('blogConfigItemsperPage', helper::FILTER_INT,true),
'version' => $this->getData(['module', $this->getUrl(0), 'config', 'version'])
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -422,6 +422,7 @@ class download extends common {
'feeds' => $this->getInput('downloadConfigShowFeeds',helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('downloadConfigFeedslabel',helper::FILTER_STRING_SHORT),
'itemsperPage' => $this->getInput('blogConfigItemsperPage', helper::FILTER_INT,true),
'version' => $this->getData(['module', $this->getUrl(0), 'config', 'version'])
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -67,9 +67,9 @@ class news extends common {
*/
private function update() {
// Insitialisation de la version
if ($this->getData(['module', $this->getUrl(0), 'config', 'version']) === NULL) {
$this->setData(['module', $this->getUrl(0), 'config', 'version','0.0']);
}
//if ($this->getData(['module', $this->getUrl(0), 'config', 'version']) === NULL) {
// $this->setData(['module', $this->getUrl(0), 'config', 'version','0.0']);
//}
// Version 3.0
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'version']), '3.0', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 16]);
@ -181,7 +181,8 @@ class news extends common {
'feeds' => $this->getInput('newsConfigShowFeeds',helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT),
'itemsperPage' => $this->getInput('newsConfigItemsperPage', helper::FILTER_INT,true),
'itemsperCol' => $this->getInput('newsConfigItemsperCol', helper::FILTER_INT,true)
'itemsperCol' => $this->getInput('newsConfigItemsperCol', helper::FILTER_INT,true),
'version' => $this->getData(['module', $this->getUrl(0), 'config', 'version'])
]]);
// Valeurs en sortie
$this->addOutput([