diff --git a/lib/Alchemy/Phrasea/Cache/Manager.php b/lib/Alchemy/Phrasea/Cache/Manager.php index d2358699b9..93f0fa2fc4 100644 --- a/lib/Alchemy/Phrasea/Cache/Manager.php +++ b/lib/Alchemy/Phrasea/Cache/Manager.php @@ -48,7 +48,7 @@ class Manager $this->parser = new \Symfony\Component\Yaml\Yaml(); $this->core = $core; - $this->registry = $this->parser->parse($file); + $this->registry = $this->parser->parse($file) ? : array(); } protected function exists($name) @@ -63,6 +63,8 @@ class Manager $this->get($cacheKey, $service_name)->getDriver()->flushAll(); } + file_put_contents($this->cacheFile->getPathname(), ''); + return $this; } diff --git a/lib/classes/patch/361.class.php b/lib/classes/patch/361.class.php new file mode 100644 index 0000000000..c8436161ad --- /dev/null +++ b/lib/classes/patch/361.class.php @@ -0,0 +1,100 @@ +release; + } + + public function require_all_upgrades() + { + return false; + } + + /** + * + * @return Array + */ + function concern() + { + return $this->concern; + } + + function apply(base &$appbox) + { + $Core = \bootstrap::getCore(); + + $em = $Core->getEntityManager(); + + $repository = $em->getRepository('\Entities\BasketElement'); + + foreach($repository->findAll() as $basketElement) + { + try + { + $basketElement->getRecord(); + } + catch(\Exception $e) + { + $em->remove($basketElement); + } + } + + + $em = $Core->getEntityManager(); + + $repository = $em->getRepository('\Entities\Basket'); + + foreach($repository->findAll() as $basket) + { + $htmlDesc = $basket->getDescription(); + + $description = trim(strip_tags(str_replace("
", "\n", $htmlDesc))); + + if($htmlDesc == $description) + { + continue; + } + + $basket->setDescription($description); + } + + $em->flush(); + + return true; + } + +}