Announcement

Collapse
No announcement yet.

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

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

  • 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

  • #2
    Hi,

    Steps to reproduce please.

    Comment


    • #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/

    • #4
      Could not reproduce.

      Comment


      • #5
        We are using the docker version of EspoCRM

        Comment


        • #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


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

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

            Comment


            • #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.

              Comment

              Working...
              X