From: ArthurHoaro Date: Sat, 4 Feb 2017 11:01:48 +0000 (+0100) Subject: Fixes #775: LinkDB do not access LinkDB before ID system migration X-Git-Tag: v0.9.0~56^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=c03455af1161befa404ed8759ca55b63bbf593a2;p=github%2Fshaarli%2FShaarli.git Fixes #775: LinkDB do not access LinkDB before ID system migration To access LinkDB items with its ArrayAccess implementation, the IDs must be consistent, which isn't the case before `updateMethodDatastoreIds()` execution. v0.6.4 method `updateMethodRenameDashTags()` was accessing it, so an upgrade <0.6.4 to >0.8.x was failing. This just move the minor update `RenameDashTags` after the IDs update. --- diff --git a/application/Updater.php b/application/Updater.php index eb03c6d3..90aba745 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -132,21 +132,6 @@ class Updater return true; } - /** - * Rename tags starting with a '-' to work with tag exclusion search. - */ - public function updateMethodRenameDashTags() - { - $linklist = $this->linkDB->filterSearch(); - foreach ($linklist as $key => $link) { - $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']); - $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); - $this->linkDB[$key] = $link; - } - $this->linkDB->save($this->conf->get('resource.page_cache')); - return true; - } - /** * Move old configuration in PHP to the new config system in JSON format. * @@ -257,6 +242,21 @@ class Updater return true; } + /** + * Rename tags starting with a '-' to work with tag exclusion search. + */ + public function updateMethodRenameDashTags() + { + $linklist = $this->linkDB->filterSearch(); + foreach ($linklist as $key => $link) { + $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']); + $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); + $this->linkDB[$key] = $link; + } + $this->linkDB->save($this->conf->get('resource.page_cache')); + return true; + } + /** * Initialize API settings: * - api.enabled: true