Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import bug : Format of duedate in recomandation #30

Closed
jfrocha opened this issue Aug 16, 2017 · 2 comments
Closed

Import bug : Format of duedate in recomandation #30

jfrocha opened this issue Aug 16, 2017 · 2 comments
Labels

Comments

@jfrocha
Copy link
Contributor

jfrocha commented Aug 16, 2017

When recommendations have a duedate (Deadline in implementation of the risk treatment plan) , import function gets bug below:

{"errors":[{"message":"Call to a member function format() on array","error":"error-exception","exception":{"class":"Error","file":"\/var\/www\/monarc\/fo\/vendor\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Types\/DateTimeType.php","line":53,"message":"Call to a member function format() on array","stacktrace":"#0 \/var\/www\/monarc\/fo\/vendor\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php(114): Doctrine\\DBAL\\Types\\DateTimeType-\u003EconvertToDatabaseValue(Array, Object(Doctrine\\DBAL\\Platforms\\MySQL57Platform))\n#1 \/var\/www\/monarc\/fo\/vendor\/doctrine\/orm\/lib\/Doctrine\/ORM\/Persisters\/Entity\/BasicEntityPersister.php(277): Doctrine\\DBAL\\Statement-\u003EbindValue(7, Array, Object(Doctrine\\DBAL\\Types\\DateTimeType))\n#2 \/var\/www\/monarc\/fo\/vendor\/doctrine\/orm\/lib\/Doctrine\/ORM\/UnitOfWork.php(1014): Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister-\u003EexecuteInserts()\n#3 \/var\/www\/monarc\/fo\/vendor\/doctrine\/orm\/lib\/Doctrine\/ORM\/UnitOfWork.php(378): Doctrine\\ORM\\UnitOfWork-\u003EexecuteInserts(Object(Doctrine\\ORM\\Mapping\\ClassMetadata))\n#4 \/var\/www\/monarc\/fo\/vendor\/doctrine\/orm\/lib\/Doctrine\/ORM\/EntityManager.php(356): Doctrine\\ORM\\UnitOfWork-\u003Ecommit(NULL)\n#5 \/var\/www\/monarc\/fo\/vendor\/monarc\/core\/src\/MonarcCore\/Model\/Db.php(298): Doctrine\\ORM\\EntityManager-\u003Eflush()\n#6 \/var\/www\/monarc\/fo\/vendor\/monarc\/core\/src\/MonarcCore\/Model\/Db.php(278): MonarcCore\\Model\\Db-\u003Eflush()\n#7 \/var\/www\/monarc\/fo\/vendor\/monarc\/core\/src\/MonarcCore\/Model\/Table\/AbstractEntityTable.php(316): MonarcCore\\Model\\Db-\u003Esave(Object(MonarcFO\\Model\\Entity\\Recommandation), true)\n#8 \/var\/www\/monarc\/fo\/vendor\/monarc\/frontoffice\/src\/MonarcFO\/Service\/AnrInstanceService.php(404): MonarcCore\\Model\\Table\\AbstractEntityTable-\u003Esave(Object(MonarcFO\\Model\\Entity\\Recommandation))\n#9 \/var\/www\/monarc\/fo\/vendor\/monarc\/frontoffice\/src\/MonarcFO\/Service\/AnrInstanceService.php(653): MonarcFO\\Service\\AnrInstanceService-\u003EimportFromArray(Array, Object(MonarcFO\\Model\\Entity\\Anr), 8202, \u0027merge\u0027, true, Array)\n#10 \/var\/www\/monarc\/fo\/vendor\/monarc\/frontoffice\/src\/MonarcFO\/Service\/AnrInstanceService.php(653): MonarcFO\\Service\\AnrInstanceService-\u003EimportFromArray(Array, Object(MonarcFO\\Model\\Entity\\Anr), 8196, \u0027merge\u0027, true, Array)\n#11 \/var\/www\/monarc\/fo\/vendor\/monarc\/frontoffice\/src\/MonarcFO\/Service\/AnrInstanceService.php(702): MonarcFO\\Service\\AnrInstanceService-\u003EimportFromArray(Array, Object(MonarcFO\\Model\\Entity\\Anr), NULL, \u0027merge\u0027, true, Array, true)\n#12 \/var\/www\/monarc\/fo\/vendor\/monarc\/frontoffice\/src\/MonarcFO\/Service\/AnrInstanceService.php(60): MonarcFO\\Service\\AnrInstanceService-\u003EimportFromArray(Array, Object(MonarcFO\\Model\\Entity\\Anr), NULL, \u0027merge\u0027, true, Array, true)\n#13 \/var\/www\/monarc\/fo\/vendor\/monarc\/frontoffice\/src\/MonarcFO\/Controller\/ApiAnrImportAbstractController.php(39): MonarcFO\\Service\\AnrInstanceService-\u003EimportFromFile(288, Array)\n#14 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-mvc\/src\/Controller\/AbstractRestfulController.php(458): MonarcFO\\Controller\\ApiAnrImportAbstractController-\u003Ecreate(Array)\n#15 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-mvc\/src\/Controller\/AbstractRestfulController.php(416): Zend\\Mvc\\Controller\\AbstractRestfulController-\u003EprocessPostData(Object(Zend\\Http\\PhpEnvironment\\Request))\n#16 [internal function]: Zend\\Mvc\\Controller\\AbstractRestfulController-\u003EonDispatch(Object(Zend\\Mvc\\MvcEvent))\n#17 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-eventmanager\/src\/EventManager.php(490): call_user_func(Array, Object(Zend\\Mvc\\MvcEvent))\n#18 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-eventmanager\/src\/EventManager.php(263): Zend\\EventManager\\EventManager-\u003EtriggerListeners(\u0027dispatch\u0027, Object(Zend\\Mvc\\MvcEvent), Object(Closure))\n#19 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-mvc\/src\/Controller\/AbstractController.php(118): Zend\\EventManager\\EventManager-\u003EtriggerEventUntil(Object(Closure), Object(Zend\\Mvc\\MvcEvent))\n#20 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-mvc\/src\/Controller\/AbstractRestfulController.php(300): Zend\\Mvc\\Controller\\AbstractController-\u003Edispatch(Object(Zend\\Http\\PhpEnvironment\\Request), Object(Zend\\Http\\PhpEnvironment\\Response))\n#21 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-mvc\/src\/DispatchListener.php(118): Zend\\Mvc\\Controller\\AbstractRestfulController-\u003Edispatch(Object(Zend\\Http\\PhpEnvironment\\Request), Object(Zend\\Http\\PhpEnvironment\\Response))\n#22 [internal function]: Zend\\Mvc\\DispatchListener-\u003EonDispatch(Object(Zend\\Mvc\\MvcEvent))\n#23 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-eventmanager\/src\/EventManager.php(490): call_user_func(Array, Object(Zend\\Mvc\\MvcEvent))\n#24 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-eventmanager\/src\/EventManager.php(263): Zend\\EventManager\\EventManager-\u003EtriggerListeners(\u0027dispatch\u0027, Object(Zend\\Mvc\\MvcEvent), Object(Closure))\n#25 \/var\/www\/monarc\/fo\/vendor\/zendframework\/zend-mvc\/src\/Application.php(340): Zend\\EventManager\\EventManager-\u003EtriggerEventUntil(Object(Closure), Object(Zend\\Mvc\\MvcEvent))\n#26 \/var\/www\/monarc\/fo\/public\/index.php(24): Zend\\Mvc\\Application-\u003Erun()\n#27 {main}"}}]}

@jfrocha jfrocha added the bug label Aug 16, 2017
@cedricbonhomme
Copy link
Member

just to note, I think it is linked : monarc-project/zm-core#2

@jerolomb
Copy link
Contributor

It seems that the export send the duedate of a recommandation like an array :
"duedate":{"date":"2017-10-10 00:00:00.000000","timezone_type":3,"timezone":"Europe/Luxembourg"}

But i think the application is just waiting for a DateTime and not an array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants