Commit 8c6ba4c2 authored by Patrick Barroca's avatar Patrick Barroca 🐧

Merge branch 'hotline' into 'master'

Hotline

See merge request !3128
parents 86c41e74 f638ecf7
Pipeline #7016 passed with stage
in 35 minutes and 50 seconds
14/05/2019 - v8.0.15
- ticket #88956 : Arte VOD : Amélioration du script de mise à jour des auteurs
13/05/2019 - v8.0.14
- ticket #88526 : SIGB Nanook : possibilité d'accéder directement à une notice Bokeh depuis Nanook
......
......@@ -21,6 +21,33 @@
class Class_Migration_ArteVODAuthorsOrder {
use Trait_MemoryCleaner;
public function updateAuthorsForAllAlbums($closure=null) {
try {
$page = 0;
while($albums = Class_Album::findAllBy(['type_doc_id' => Class_TypeDoc::ARTEVOD,
'order' => 'id',
'limitPage' => [$page, 500]])) {
$this->_runPage($albums, $closure);
$this->_cleanMemory();
$page++;
}
} catch(Exception $e) {
return;
}
}
protected function _runPage($albums, $closure) {
foreach($albums as $album) {
$this->updateAuthors($album);
if ($closure)
$closure($album);
}
}
public function updateAuthors($album) {
$old_authors = new Storm_Collection($album->getAuthors());
$album->getMarc()->clearZone('701');
......@@ -36,15 +63,6 @@ class Class_Migration_ArteVODAuthorsOrder {
}
public function updateAuthorsForAllAlbums($closure=null) {
foreach(Class_Album::findAllBy(['type_doc_id' => Class_TypeDoc::ARTEVOD]) as $album) {
$this->updateAuthors($album);
if ($closure)
$closure($album);
}
}
protected function addAuthorsTo($authors, $closure, $album) {
$authors->select($closure)
->eachDo(function ($author) use ($album)
......
......@@ -81,7 +81,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','8.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.14');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.15');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -54,7 +54,10 @@ class ArteVodLinkUpdateAuthorTest extends ModelTestCase {
->setExternalUri("http://artevod/comme-elle-respire")
->beValidated()
->save();
(new Class_Migration_ArteVODAuthorsOrder())->updateAuthorsForAllAlbums();
(new Class_Migration_ArteVODAuthorsOrder())
->setMemoryCleaner(function() {})
->updateAuthorsForAllAlbums();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment