Skip to content

EspoCRM – Open Source CRM Application

fix attribute legacy formula errors to their source

Osama Bashir5a95536f5f57
diff --git a/application/Espo/Core/Formula/Processor.php b/application/Espo/Core/Formula/Processor.php
index eec059ebc3..abbaf7fb8b 100644
--- a/application/Espo/Core/Formula/Processor.php
+++ b/application/Espo/Core/Formula/Processor.php
@@ -100,13 +100,17 @@ class Processor
return $this->processFunc($item, $function);
}
- if ($function instanceof DeprecatedBaseFunction) {
- return $function->process(self::dataToStdClass($item->getData()));
- }
-
try {
+ if ($function instanceof DeprecatedBaseFunction) {
+ return $function->process(self::dataToStdClass($item->getData()));
+ }
+
return $function->process($item->getArgumentList());
} catch (UndefinedKey $e) {
+ if ($function instanceof DeprecatedBaseFunction) {
+ throw $e;
+ }
+
throw UndefinedKey::cloneWithLevelRisen($e);
} catch (TooFewArguments|BadArgumentType|BadArgumentValue $e) {
$message = sprintf('Function %s; %s', $item->getType(), $e->getLogMessage());