Params 'field' and 'parentType' not passed along with 'file'.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marco.piccardo
    Junior Member
    • Feb 2021
    • 8

    Params 'field' and 'parentType' not passed along with 'file'.

    Hi there, I've a lot of problems making portals work.
    I've an EspoCRM 7.0.9 and I cannot succeed in making attachment fields working.

    When a portal user try to attach something to a Case record, receives a message "Params 'field' and 'parentType' not passed along with 'file'.".
    But this is not true, I've debugged the API request and that fields were passed by the frontend.

    This is the call that is made:

    POST https://.../api/v1/portal-access/60f...d5b/Attachment
    {"name":"Logotipo AF neg margin.png","type":"image/png","role":"Attachment","size":9652,"parentType": "Task","file":"data:image/png;base64,...","field":"attachments"}

    Any hint on how to solve this?
    Thanks in advance to everybody
  • yuri
    Member
    • Mar 2014
    • 8442

    #2
    Hi,

    Steps to reproduce please.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • marco.piccardo
      Junior Member
      • Feb 2021
      • 8

      #3
      I've:

      1. created a portal
      2. created a portal role
      3. created a user with the right portal role and permissions to create "Cases"
      4. the portal user logs in, tries to create a Case and when uploads something in the attachment field the error shows up

      Comment


      • esforim
        esforim commented
        Editing a comment
        Recommend you try to reproduce it on the demo: demo.espocrm.com/
    • yuri
      Member
      • Mar 2014
      • 8442

      #4
      Could not reproduce.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • marco.piccardo
        Junior Member
        • Feb 2021
        • 8

        #5
        We are using the docker version of EspoCRM

        Comment

        • marco.piccardo
          Junior Member
          • Feb 2021
          • 8

          #6
          Digging deeply I've found that in the Service/Attachment.php class this method

          public function filterCreateInput(stdClass $data): void
          {
          parent::filterCreateInput($data);

          calls the parent::filtersCreateInput. Before calling the parent function the $data has both field and parentType keys. After passing through the parent function, the parentType key is missing.

          Comment

          • marco.piccardo
            Junior Member
            • Feb 2021
            • 8

            #7
            $forbiddenAttributeList = $this->acl->getScopeForbiddenAttributeList($this->entityType, AclTable::ACTION_EDIT);

            The parentType seems to be removed because appears in this list.

            Comment

            • yuri
              Member
              • Mar 2014
              • 8442

              #8
              Seems you have an old version of the file https://github.com/espocrm/espocrm/b...aclPortal.json

              This line has been removed in v7.0 https://github.com/espocrm/espocrm/b...ortal.json#L82

              I recommend checking all other files whether they are the same as in v7.0.9 distr.
              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

              Comment

              Working...