Hey,
I just adding above code in this location espocrm\custom\Espo\Custom\Hooks\Account but each time I run above code the below error message appears
thanks in advanced
PHP Code:
public static function getFieldDef($fieldName)
{
$fileManager = new Manager();
$config = new Config($fileManager);
// $fieldName passing this value -> investmentPortfolios
$metadata = new Metadata();
file_put_contents('/var/www/espocrm/data/logs/x.log', print_r($metadata->get('entityDefs.Account.fields'), true));
}
HTML Code:
[Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP Fatal error: Call to a member function getFileList() on null in /var/www/espocrm/application/Espo/Core/Utils/File/Unifier.php on line 111, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP Stack trace:, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 1. {main}() /var/www/espocrm/api/v1/index.php:0, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 2. Espo\\Core\\Application->run() /var/www/espocrm/api/v1/index.php:33, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 3. Espo\\Core\\Utils\\Api\\Slim->run() /var/www/espocrm/application/Espo/Core/Application.php:88, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 4. Espo\\Core\\Utils\\Api\\Auth->call() /var/www/espocrm/application/Espo/Core/Utils/Api/Slim.php:125, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 5. Slim\\Middleware\\MethodOverride->call() /var/www/espocrm/application/Espo/Core/Utils/Api/Auth.php:112, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 6. Slim\\Middleware\\Flash->call() /var/www/espocrm/vendor/slim/slim/Slim/Middleware/MethodOverride.php:92, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 7. Slim\\Slim->call() /var/www/espocrm/vendor/slim/slim/Slim/Middleware/Flash.php:85, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 8. Slim\\Slim->applyHook() /var/www/espocrm/vendor/slim/slim/Slim/Slim.php:1315, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 9. call_user_func:{/var/www/espocrm/vendor/slim/slim/Slim/Slim.php:1175}() /var/www/espocrm/vendor/slim/slim/Slim/Slim.php:1175, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 10. Espo\\Core\\Application->Espo\\Core\\{closure}() /var/www/espocrm/vendor/slim/slim/Slim/Slim.php:1175, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 11. Espo\\Core\\ControllerManager->process() /var/www/espocrm/application/Espo/Core/Application.php:226, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 12. Espo\\Core\\Controllers\\Record->actionPatch() /var/www/espocrm/application/Espo/Core/ControllerManager.php:116, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 13. Espo\\Core\\Controllers\\Record->actionUpdate() /var/www/espocrm/application/Espo/Core/Controllers/Record.php:81, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 14. Espo\\Services\\Record->updateEntity() /var/www/espocrm/application/Espo/Core/Controllers/Record.php:115, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 15. Espo\\Services\\Record->storeEntity() /var/www/espocrm/application/Espo/Services/Record.php:654, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 16. Espo\\Core\\ORM\\Repositories\\RDB->save() /var/www/espocrm/application/Espo/Services/Record.php:373, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 17. Espo\\ORM\\Repositories\\RDB->save() /var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php:319, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 18. Espo\\Core\\ORM\\Repositories\\RDB->afterSave() /var/www/espocrm/application/Espo/ORM/Repositories/RDB.php:147, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 19. Espo\\Core\\HookManager->process() /var/www/espocrm/application/Espo/Core/ORM/Repositories/RDB.php:275, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 20. Espo\\Custom\\Hooks\\AccountOpening\\AccountOpening->afterSave() /var/www/espocrm/application/Espo/Core/HookManager.php:122, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 21. Espo\\Custom\\Hooks\\AccountOpening\\MissingHandler::verifyInvestmentPortfolios() /var/www/espocrm/custom/Espo/Custom/Hooks/AccountOpening/AccountOpening.php:27, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 22. Espo\\Custom\\Hooks\\AccountOpening\\MissingHandler::getFieldDef() /var/www/espocrm/custom/Espo/Custom/Hooks/AccountOpening/MissingHandler.php:336, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 23. Espo\\Core\\Utils\\Metadata->get() /var/www/espocrm/custom/Espo/Custom/Hooks/AccountOpening/MissingHandler.php:30, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 24. Espo\\Core\\Utils\\Metadata->getData() /var/www/espocrm/application/Espo/Core/Utils/Metadata.php:183, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 25. Espo\\Core\\Utils\\Metadata->init() /var/www/espocrm/application/Espo/Core/Utils/Metadata.php:167, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 26. Espo\\Core\\Utils\\File\\Unifier->unify() /var/www/espocrm/application/Espo/Core/Utils/Metadata.php:147, referer: http://10.20.50.206/ [Mon Nov 20 14:32:58 2017] [error] [client 10.20.22.193] PHP 27. Espo\\Core\\Utils\\File\\Unifier->unifySingle() /var/www/espocrm/application/Espo/Core/Utils/File/Unifier.php:75, referer: http://10.20.50.206/
Comment