Monit, remove __items and fix migration issue (#3336)

This commit is contained in:
Frank Brendel 2019-03-15 11:42:43 +01:00 committed by Ad Schellevis
parent 33d687ae0b
commit 9746ebf8f1
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class M1_0_8 extends BaseModelMigration
{
public function post($model)
{
foreach ($model->getNodeByReference('test')->__items as $test) {
foreach ($model->test->iterateItems() as $test) {
$test->type = $model->getTestType($test->condition->getNodeData());
}
// validation will fail because we want to change the type of tests linked to services

View File

@ -168,7 +168,8 @@ class Monit extends BaseModel
switch ($node->getInternalXMLTagName()) {
case 'type':
$testUuid = $parentNode->getAttribute('uuid');
if ($node->isFieldChanged() &&
if (strcmp((string)$node, 'Custom') != 0 &&
$node->isFieldChanged() &&
$this->isTestServiceRelated($testUuid)) {
$messages->appendMessage(new \Phalcon\Validation\Message(
gettext("Cannot change the type. Test is linked to a service."),