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

Document Attachment Subpanel link incorrect #6511

Closed
markbond1007 opened this issue Nov 20, 2018 · 6 comments
Closed

Document Attachment Subpanel link incorrect #6511

markbond1007 opened this issue Nov 20, 2018 · 6 comments
Assignees
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase
Milestone

Comments

@markbond1007
Copy link
Contributor

Issue

When uploading documents as linked/related to other objects (ie Accounts), the download link in the subpanel is incorrect.

The link is like this:

http://suitecrm.icestarmedia.com/index.php?entryPoint=download&id=d72b597a-429a-61e4-0930-5bf3e8d8c6f9&type=Accounts

prior to the updated to 7.10.10 the link was like this:
https://crm.workingoptions.co.uk/index.php?preview=yes&entryPoint=download&id=2912e3c6-ada0-7a64-6658-5bdc70c9028a&type=Documents

When clicking the new link it provides an "Invalid File reference" error. Visiting the document full details object and downloading is fine (and works) so the file is correctly stored.

Expected Behavior

CLicking the download/preview links on the subpanel should download the file.

Actual Behavior

Get a white page with "Invalid file reference"

Possible Fix

Link is wrong, its pulling "type=" from the parent object rather than the Document Object.

Steps to Reproduce

  1. Clean install of Suite 7.10.10
  2. Install demo data
  3. upload a document to any Account via the quick form
  4. within the account try and click the link from the subpanel

Context

Your Environment

  • SuiteCRM Version used: 7.10.10
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome/FF
  • Environment name and version (e.g. MySQL, PHP 7): MySQL PHP7 FPM
  • Operating System and version (e.g Ubuntu 16.04): Debian
@pgorod
Copy link
Contributor

pgorod commented Nov 20, 2018

I've seen a similar thing recently with Images, also the type=module part comes out wrong. I suppose both issues come from the same code change, it would be nice to start by determining the commit the changed this...

@cameronblaikie cameronblaikie added Type:Bug Bugs within the core SuiteCRM codebase Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds labels Nov 27, 2018
@J-Light
Copy link
Contributor

J-Light commented Nov 28, 2018

I think its was introduced in commit 0b7567c and relates #5822. @PedroErnst @daniel-samson

    global $currentModule;
    $displayParams['module'] = $currentModule;

The Value of $displayParams is as follows:

 |-[-]$displayParams[18]
 |  |-   name                             filename
 |  |-   vname                            LBL_LIST_FILENAME
 |  |-   width                            20%
 |  |-   module                           Documents
 |  |-   sortable                         false
 |  |-[-]displayParams[1]
 |  |  `-   module                           Documents                                               

The module field is then overwritten to the the current module. The smarty template is

type={if empty($vardef.displayParams.module)}{$displayParams.module}{else}{$vardef.displayParams.module}{/if}

The condition empty($vardef.displayParams.module) is True so $displayParams.module is used which results in type not equal Documents and results in invalid link.

@jack7anderson7
Copy link
Contributor

Hi @markbond1007 @J-Light Can you please test the propose fix and confirm that it works as expected.
#6599

@markbond1007
Copy link
Contributor Author

@jack7anderson7 I have tried this fix and can confirm the links work correctly after applying the patch (7.10.10 Suitecrm)

@J-Light
Copy link
Contributor

J-Light commented Dec 12, 2018

@jack7anderson7 👍 ... tested and works, thanks.

samus-aran added a commit that referenced this issue Dec 13, 2018
Fixed #6511 - Document Attachment Subpanel link incorrect
@samus-aran
Copy link
Contributor

Thanks @markbond1007 & @markbond1007 You're testing is very much appreciated! Thats it merged into the next release.

@samus-aran samus-aran added Resolved: Next Release and removed Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution labels Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

7 participants