Skip to content
Snippets Groups Projects
Commit 5bf2309a authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #74753 : fix bad batch type

parent 63a22d49
Branches
Tags
2 merge requests!2817Dev#74753 dev maj connecteur 1dtouch,!2797Dev#74753 dev maj connecteur 1dtouch
......@@ -145,10 +145,13 @@ abstract class Class_Migration_DigitalResource_Abstract {
protected function renameBatches() {
if(!$batch = Class_Batch::findFirstBy(['type' => $this->_getOldBatchName()]))
if (!$old = $this->_getOldBatchName())
return $this;
$batch->setType($this->_getConfig()->getName())->save();
if(!$batch = Class_Batch::findFirstBy(['type' => $old]))
return $this;
$batch->setType($this->_getConfig()->getBatch())->save();
return $this;
}
......
......@@ -225,7 +225,7 @@ class Class_Migration_DigitialResource_1DTouchActivatedTest
/** @test */
public function batchDiMusicShouldExists() {
$batch = Class_Batch::findFirstBy(['type' => 'DiMusic']);
$batch = Class_Batch::findFirstBy(['type' => 'DiMusic_Batch']);
$this->assertNotNull($batch);
$this->assertEquals(1, $batch->getId());
$this->assertEquals('2018-08-13 07:46:22', $batch->getLastRun());
......
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