After upgrading to v7.4.3 (I'm not sure it this is the version when started the problem, but it was working a couple of months before), I started having the following problem.
The following line code is giving the error 500
entity\addLinkMultipleId('empresas', '14');
After executing this formula, the new account is added to empresas link, that is a many to many relationship.
The problem is that the formula flow breaks after this and the next formulas are not executed.
Some weird things.
When I ask to print the empresasNames, it gives null.
When I ask to print the empresasIds, it gives error 500 and nothing is printed.
this is the log
The following line code is giving the error 500
entity\addLinkMultipleId('empresas', '14');
After executing this formula, the new account is added to empresas link, that is a many to many relationship.
The problem is that the formula flow breaks after this and the next formulas are not executed.
Some weird things.
When I ask to print the empresasNames, it gives null.
When I ask to print the empresasIds, it gives error 500 and nothing is printed.
this is the log
Code:
ERROR: Slim Application Error Type: TypeError Code: 0 Message: in_array(): Argument #2 ($haystack) must be of type array, null given File: /var/www/html/espocrm/application/Espo/Core/ORM/Entity.php Line: 430 Trace: #0 /var/www/html/espocrm/application/Espo/Core/ORM/Entity.php(430): in_array('14', NULL) #1 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/EntityGroup/AddLinkMultipleIdType.php(62): Espo\Core\ORM\Entity->addLinkMultipleId('empresas', '14') #2 /var/www/html/espocrm/application/Espo/Core/Formula/Processor.php(113): Espo\Core\Formula\Functions\EntityGroup\AddLinkMultipleIdType->process(Object(stdClass)) #3 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/BaseFunction.php(97): Espo\Core\Formula\Processor->process(Object(Espo\Core\Formula\Argument)) #4 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/BundleType.php(42): Espo\Core\Formula\Functions\BaseFunction->evaluate(Object(Espo\Core\Formula\Argument)) #5 /var/www/html/espocrm/application/Espo/Core/Formula/Processor.php(116): Espo\Core\Formula\Functions\BundleType->process(Object(Espo\Core\Formula\ArgumentList)) #6 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/BaseFunction.php(97): Espo\Core\Formula\Processor->process(Object(Espo\Core\Formula\Argument)) #7 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/IfThenType.php(46): Espo\Core\Formula\Functions\BaseFunction->evaluate(Object(Espo\Core\Formula\Argument)) #8 /var/www/html/espocrm/application/Espo/Core/Formula/Processor.php(116): Espo\Core\Formula\Functions\IfThenType->process(Object(Espo\Core\Formula\ArgumentList)) #9 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/BaseFunction.php(97): Espo\Core\Formula\Processor->process(Object(Espo\Core\Formula\Argument)) #10 /var/www/html/espocrm/application/Espo/Core/Formula/Functions/BundleType.php(42): Espo\Core\Formula\Functions\BaseFunction->evaluate(Object(Espo\Core\Formula\Argument)) #11 /var/www/html/espocrm/application/Espo/Core/Formula/Processor.php(116): Espo\Core\Formula\Functions\BundleType->process(Object(Espo\Core\Formula\ArgumentList)) #12 /var/www/html/espocrm/application/Espo/Core/Formula/Evaluator.php(86): Espo\Core\Formula\Processor->process(Object(Espo\Core\Formula\Argument)) #13 /var/www/html/espocrm/application/Espo/Core/Formula/Manager.php(60): Espo\Core\Formula\Evaluator->process('ifThen(projectN...', Object(Espo\Custom\Entities\Medicoes), Object(stdClass)) #14 /var/www/html/espocrm/application/Espo/Modules/Advanced/Core/Workflow/Actions/UpdateEntity.php(35): Espo\Core\Formula\Manager->run('ifThen(projectN...', Object(Espo\Custom\Entities\Medicoes), Object(stdClass)) #15 /var/www/html/espocrm/application/Espo/Modules/Advanced/Core/Workflow/Actions/Base.php(267): Espo\Modules\Advanced\Core\Workflow\Actions\UpdateEntity->run(Object(Espo\Custom\Entities\Medicoes), Object(stdClass)) #16 /var/www/html/espocrm/application/Espo/Modules/Advanced/Core/Workflow/ActionManager.php(72): Espo\Modules\Advanced\Core\Workflow\Actions\Base->process(Object(Espo\Custom\Entities\Medicoes), Object(stdClass), NULL, Object(stdClass)) #17 /var/www/html/espocrm/application/Espo/Modules/Advanced/Core/Workflow/ActionManager.php(43): Espo\Modules\Advanced\Core\Workflow\ActionManager->runAction(Object(stdClass), '5dfc36d11fd3540...', Object(stdClass)) #18 /var/www/html/espocrm/application/Espo/Modules/Advanced/Core/WorkflowManager.php(197): Espo\Modules\Advanced\Core\Workflow\ActionManager->runActions(Array) #19 /var/www/html/espocrm/application/Espo/Modules/Advanced/Hooks/Common/Workflow.php(48): Espo\Modules\Advanced\Core\WorkflowManager->process(Object(Espo\Custom\Entities\Medicoes), 'afterRecordSave...', Array) #20 /var/www/html/espocrm/application/Espo/Core/Hook/GeneralInvoker.php(186): Espo\Modules\Advanced\Hooks\Common\Workflow->afterSave(Object(Espo\Custom\Entities\Medicoes), Array, Array) #21 /var/www/html/espocrm/application/Espo/Core/HookManager.php(118): Espo\Core\Hook\GeneralInvoker->invoke(Object(Espo\Modules\Advanced\Hooks\Common\Workflow), 'afterSave', Object(Espo\Custom\Entities\Medicoes), Array, Array) #22 /var/www/html/espocrm/application/Espo/Core/Repositories/Database.php(320): Espo\Core\HookManager->process('Medicoes', 'afterSave', Object(Espo\Custom\Entities\Medicoes), Array) #23 /var/www/html/espocrm/application/Espo/ORM/Repository/RDBRepository.php(163): Espo\Core\Repositories\Database->afterSave(Object(Espo\Custom\Entities\Medicoes), Array) #24 /var/www/html/espocrm/application/Espo/Core/Repositories/Database.php(138): Espo\ORM\Repository\RDBRepository->save(Object(Espo\Custom\Entities\Medicoes), Array) #25 /var/www/html/espocrm/application/Espo/ORM/EntityManager.php(247): Espo\Core\Repositories\Database->save(Object(Espo\Custom\Entities\Medicoes), Array) #26 /var/www/html/espocrm/application/Espo/Tools/Formula/Service.php(105): Espo\ORM\EntityManager->saveEntity(Object(Espo\Custom\Entities\Medicoes)) #27 /var/www/html/espocrm/application/Espo/Controllers/Formula.php(85): Espo\Tools\Formula\Service->run('entity\\addLinkM...', Object(Espo\Core\Field\LinkParent)) #28 /var/www/html/espocrm/application/Espo/Core/Api/ControllerActionProcessor.php(87): Espo\Controllers\Formula->postActionRun(Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #29 /var/www/html/espocrm/application/Espo/Core/Api/ControllerActionHandler.php(65): Espo\Core\Api\ControllerActionProcessor->process('Formula', 'run', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #30 /var/www/html/espocrm/vendor/slim/slim/Slim/MiddlewareDispatcher.php(65): Espo\Core\Api\ControllerActionHandler->handle(Object(Slim\Psr7\Request)) #31 /var/www/html/espocrm/application/Espo/Core/Api/RouteProcessor.php(222): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #32 /var/www/html/espocrm/application/Espo/Core/Api/RouteProcessor.php(149): Espo\Core\Api\RouteProcessor->processControllerAction(Object(Espo\Core\Api\ProcessData), Object(Slim\Psr7\Request), Object(Espo\Core\Api\ResponseWrapper)) #33 /var/www/html/espocrm/application/Espo/Core/Api/RouteProcessor.php(127): Espo\Core\Api\RouteProcessor->processAfterAuth(Object(Espo\Core\Api\ProcessData), Object(Slim\Psr7\Request), Object(Espo\Core\Api\ResponseWrapper)) #34 /var/www/html/espocrm/application/Espo/Core/Api/RouteProcessor.php(78): Espo\Core\Api\RouteProcessor->processInternal(Object(Espo\Core\Api\ProcessData), Object(Slim\Psr7\Request), Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #35 /var/www/html/espocrm/application/Espo/Core/Api/Starter.php(109): Espo\Core\Api\RouteProcessor->process(Object(Espo\Core\Api\ProcessData), Object(Slim\Psr7\Request), Object(Slim\Psr7\Response)) #36 /var/www/html/espocrm/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(38): Espo\Core\Api\Starter->Espo\Core\Api\{closure}(Object(Slim\Psr7\Request), Object(Slim\Psr7\Response), Array) #37 /var/www/html/espocrm/vendor/slim/slim/Slim/Routing/Route.php(358): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Psr7\Request), Object(Slim\Psr7\Response), Array) #38 /var/www/html/espocrm/vendor/slim/slim/Slim/MiddlewareDispatcher.php(65): Slim\Routing\Route->handle(Object(Slim\Psr7\Request)) #39 /var/www/html/espocrm/vendor/slim/slim/Slim/MiddlewareDispatcher.php(65): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #40 /var/www/html/espocrm/vendor/slim/slim/Slim/Routing/Route.php(315): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #41 /var/www/html/espocrm/vendor/slim/slim/Slim/Routing/RouteRunner.php(68): Slim\Routing\Route->run(Object(Slim\Psr7\Request)) #42 /var/www/html/espocrm/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(45): Slim\Routing\RouteRunner->handle(Object(Slim\Psr7\Request)) #43 /var/www/html/espocrm/vendor/slim/slim/Slim/MiddlewareDispatcher.php(121): Slim\Middleware\RoutingMiddleware->process(Object(Slim\Psr7\Request), /var/www/html/espocrm/application/Espo/Core/Application/RunnerRunner.php(87): Espo\Core\ApplicationRunners\Api->run() #52 /var/www/html/espocrm/application/Espo/Core/Application.php(78): Espo\Core\Application\RunnerRunner->run('Espo\\Core\\Appli...', NULL) #53 /var/www/html/espocrm/public/api/v1/index.php(37): Espo\Core\Application->run('Espo\\Core\\Appli...') #54 {main} Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor.
Comment