Announcement

Collapse
No announcement yet.

After the update does not work Service Action

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • After the update does not work Service Action

    Hello!
    After updating Espo and the Module, this workflow stopped working normally. How to fix it? Because of what is it? Before the upgrade, it worked.
    I have a lot of worker threads working on the basis of Service Action.

    PHP Code:
    <?php

    namespace Espo\Custom\Services;
    use 
    \Espo\ORM\Entity;
    class 
    SetRelationFeld extends \Espo\Core\Services\Base
    {
        public function 
    setRelationFeldAction($workflowIdEntity $entity, array $additionalParameters null)
        {        
                
    $opportunity $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));


                
    $saveStage $opportunity->get('stage');
                
    $arrayStage = array("New" ,"Diagnostics","Repairs","Searchdetails","CoordinationClient","WaitPrePaid","PurchaseDetails");
                if (
    in_array($saveStage,$arrayStage)){




                    
    $stage "Waiting Parts";
                    if (
    $opportunity) {
                            
    $opportunity->set(array('stage'=>$stage));
                            
    $this->getEntityManager()->saveEntity($opportunity, array('skipWorkflow' =&gttrue));
                    }
                }
        }
    }
    ?&
    gt
    Click image for larger version

Name:	OnPaste.20180117-010149.png
Views:	520
Size:	4.4 KB
ID:	33871
    Attached Files
    Last edited by mr2d2; 01-19-2018, 10:10 AM.

  • #2
    Hi,

    Try to to remove array type hint `public function setRelationFeldAction($workflowId, Entity $entity, $additionalParameters = null)`

    Comment


    • #3
      >
      PHP Code:
       public function setRelationFeldAction($workflowIdEntity $entity$additionalParameters null
      the problem did not dare.
      Last edited by mr2d2; 01-19-2018, 10:08 AM.

      Comment


      • #4
        public function setRelationFeldAction($workflowId, Entity $entity, array $additionalParameters = null) - current (doesn't work)
        public function setRelationFeldAction($workflowId, Entity $entity, $additionalParameters = null) - has to be

        for now $additionalParameters could be null or an object.

        Comment


        • #5
          Originally posted by tanya View Post
          public function setRelationFeldAction($workflowId, Entity $entity, array $additionalParameters = null) - current (doesn't work)
          public function setRelationFeldAction($workflowId, Entity $entity, $additionalParameters = null) - has to be

          for now $additionalParameters could be null or an object.
          the problem did not dare.

          Comment


          • #6
            Bad server response - what do you see in espo log?

            Comment


            • #7
              Originally posted by tanya View Post
              Bad server response - what do you see in espo log?
              Share your pictures, send large videos, exchange music or transfer big files. No registration required. Unlimited upload/download speed.

              log file

              Comment


              • #8

                [2018-01-19 10:42:12] Espo.ERROR: Workflow [Utils::getFieldValue]: The related field [assignedUser.roles] entity [Opportunity] has unsupported instance [NULL]. [] []
                [2018-01-19 10:42:12] Espo.WARNING: E_WARNING: in_array() expects parameter 2 to be array, null given {"code":2,"message":"in_array() expects parameter 2 to be array, null given","file":"/var/www/u0334546/public_html/crm-crm.ru/application/Espo/Modules/Advanced/Core/Workflow/Conditions/Has.php","line":33,"context":{"fieldValue":null,"s ubjectValue":"5a43ea8853b6e1c54"}} []
                [2018-01-19 10:42:12] Espo.ERROR: Workflow [Utils::getFieldValue]: The related field [assignedUser.roles] entity [Opportunity] has unsupported instance [NULL]. [] []
                [2018-01-19 10:42:12] Espo.WARNING: E_WARNING: in_array() expects parameter 2 to be array, null given {"code":2,"message":"in_array() expects parameter 2 to be array, null given","file":"/var/www/u0334546/public_html/crm-crm.ru/application/Espo/Modules/Advanced/Core/Workflow/Conditions/Has.php","line":33,"context":{"fieldValue":null,"s ubjectValue":"58320dc29222d8cc5"}} []


                The problem is not related with service, but only with a workflow.
                Could you share with me a screenshot of your workflow and the record in database (table workflow, find the needed by ID)
                also what is your current version of EspoCRM and Advanced Pack?
                Last edited by yuri; 01-21-2018, 07:24 AM.

                Comment


                • #9
                  Sorry for scrolling.
                  My version of Advanced Pack 1.28.7
                  EspoCRM version 5.0.2


                  Click image for larger version  Name:	OnPaste.20180119-211516.png Views:	1 Size:	44.7 KB ID:	33889
                  workflow

                  the record in database http://dropmefiles.com/yK1kt
                  Last edited by mr2d2; 01-19-2018, 06:59 PM.

                  Comment


                  • #10
                    tanya, how to fix it?

                    Comment


                    • yuri
                      yuri commented
                      Editing a comment
                      Saturday and Sunday are days off.

                  • #11
                    Tested on EspoCRM 5.0.3 with Advanced Pack 1.28.8. For me it works well.
                    Try to find the problem with a debug mode, https://www.espocrm.com/documentatio...debugging-mode.
                    Job Offers and Requests

                    Comment

                    Working...
                    X