Skip to content

Bug: Webservice vtws_file_retrieve : Id specified is incorrect

error from include/Webservices/FileRetrieve.php line 36

error happens when there are multiple entries in vtiger_seattachmentsrel for the attachement id

for example I have created a organization, then create a document with attachements, then add this documents to the organization this time there will be two entries in vtiger_seattachmentsrel, one for relation with document and other is for relation with organization.

when I call vtws_file_retrieve function to retrieve attachment of a document, it first retrieves related crm id using vtws_getAttachmentRecordId function. It should actually retrieve crm id of document, but it retrieve crm id of Account and it cause module name mismatch and throw this error

Fix: change vtws_file_retrieve function so that we pass the parent record id as argument and do not retrieve the parent record id