Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 70bcdc5

Browse files
author
Predprod
committed
Fix iblock autoupdate
1 parent ba0359e commit 70bcdc5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Autocreate/Handlers/OnBeforeIBlockUpdate.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@
22

33
namespace Arrilot\BitrixMigrations\Autocreate\Handlers;
44

5+
use Arrilot\BitrixMigrations\Exceptions\SkipHandlerException;
6+
57
class OnBeforeIBlockUpdate extends BaseHandler implements HandlerInterface
68
{
79
/**
810
* Constructor.
911
*
1012
* @param array $params
13+
* @throws SkipHandlerException
1114
*/
1215
public function __construct($params)
1316
{
1417
$this->fields = $params[0];
18+
19+
// Если кода нет то миграция создастся битая.
20+
// Еще это позволяет решить проблему с тем что создается лишняя миграция для торгового каталога
21+
// когда обновляют связанный с ним инфоблок.
22+
if (!$this->fields['CODE']) {
23+
throw new SkipHandlerException();
24+
}
1525
}
1626

1727
/**

0 commit comments

Comments
 (0)