Merge branch 'hotfix/4.8.3'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
@@ -40,6 +40,12 @@ class ValueType extends Base
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
return $item->value;
|
||||
$value = $item->value;
|
||||
|
||||
if (is_string($value)) {
|
||||
$value = str_replace("\\n", "\n", $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
@@ -47,7 +47,7 @@ class VariableType extends Base
|
||||
}
|
||||
|
||||
if (!property_exists($this->getVariables(), $name)) {
|
||||
throw new Error();
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->getVariables()->$name;
|
||||
|
||||
@@ -926,6 +926,20 @@ class FormulaTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
function testStringNewLine()
|
||||
{
|
||||
$item = json_decode('
|
||||
{
|
||||
"type": "value",
|
||||
"value": "test\\ntest"
|
||||
}
|
||||
');
|
||||
|
||||
$result = $this->formula->process($item, $this->entity);
|
||||
|
||||
$this->assertEquals("test\ntest", $result);
|
||||
}
|
||||
|
||||
function testVariable()
|
||||
{
|
||||
$item = json_decode('
|
||||
|
||||
Reference in New Issue
Block a user