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

dev/core#5179 Afform - Enable file downloads #31459

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

colemanw
Copy link
Member

Overview

Fixes dev/core#5179.

Users with 'access uploaded files' permission (or afform entities with permission checks disables) will see uploaded files as a link which can be clicked to download the file.

Copy link

civibot bot commented Nov 12, 2024

🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷

Introduction for new contributors...
  • If this is your first PR, an admin will greenlight automated testing with the command ok to test or add to whitelist.
  • A series of tests will automatically run. You can see the results at the bottom of this page (if there are any problems, it will include a link to see what went wrong).
  • A demo site will be built where anyone can try out a version of CiviCRM that includes your changes.
  • If this process needs to be repeated, an admin will issue the command test this please to rerun tests and build a new demo site.
  • Before this PR can be merged, it needs to be reviewed. Please keep in mind that reviewers are volunteers, and their response time can vary from a few hours to a few weeks depending on their availability and their knowledge of this particular part of CiviCRM.
  • A great way to speed up this process is to "trade reviews" with someone - find an open PR that you feel able to review, and leave a comment like "I'm reviewing this now, could you please review mine?" (include a link to yours). You don't have to wait for a response to get started (and you don't have to stop at one!) the more you review, the faster this process goes for everyone 😄
  • To ensure that you are credited properly in the final release notes, please add yourself to contributor-key.yml
  • For more information about contributing, see CONTRIBUTING.md.
Quick links for reviewers...

➡️ Online demo of this PR 🔗

@civibot civibot bot added the master label Nov 12, 2024
Copy link

civibot bot commented Nov 12, 2024

The issue associated with the Pull Request can be viewed at https://lab.civicrm.org/dev/core/-/issues/5179

Fixes dev/core#5179
Users with 'access uploaded files' permission (or afform entities with permission checks disables)
will see uploaded files as a link which can be clicked to download the file
@Guydn
Copy link

Guydn commented Dec 13, 2024

TEST OK for download but the it i not possible to remove the file (with the cross)
Test sequence
Create 2 custom fields for individual : Photo and Resume
Create a form (individual tab) with 5 fields : Marriage status, Marriage date, Photo, Resume, Image
Update ticked, and Url ticked
Run the form for contact 127 Angelika Adams
Update Photo (png file) and Resume (docx file)
Check on contact summary: OK
Run the form again, see the 2 files
Click on docx -> download OK
Click on png file -> see the image
Use the cross to remove the docx
Submit, check the contact summary
The file is not removed
Run the form, the docx is displayed although it was removed.

I have tried also the image field (I know there is an issue with this field, it was just to check...)
i input a file jpg . I submit
I go to the contact summary error message: Deprecated function: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in CRM_Utils_File::getImageURL() (line 975 of sites/all/modules/civicrm/CRM/Utils/File.php).
I input the image in the contact summary and I run the form. The image is not displayed.

@Guydn
Copy link

Guydn commented Dec 13, 2024

Additional info
I run the form
I remove the current file (fileA)
I choose a new file (fileB)
I submit
Then I see that fileB is correctly added in the contact summary.

@Guydn
Copy link

Guydn commented Dec 13, 2024

The "remove" action is a bug in current wpmaster 5.82. alpha 1. It is not linked to this PR.

@colemanw
Copy link
Member Author

Ok since this works and the bugs noted are all pre-existing this PR is good to merge based on review.

@colemanw colemanw merged commit 6b60277 into civicrm:master Dec 13, 2024
1 check passed
@colemanw colemanw deleted the afformFileDownload branch December 13, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants