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

CRM-21654: Support custom file field on Batch Entry Profile #11520

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

monishdeb
Copy link
Member

@monishdeb monishdeb commented Jan 15, 2018

Overview

There is two issue with batch entry profile related to custom file field:

  1. It doesn't support Autocomplete-select and File field and there is a restriction placed in backend form. Which doesn't make sense for file, as allowing file field in batch entry allows us to upload a file.
  2. Validation error on batch entry form wipes out the uploaded file information.

The screenshot share below highlights the 2nd fix.

Before

screen shot 2018-01-15 at 11 22 57 am

After

screen shot 2018-01-15 at 11 23 35 am

Technical Details

#2 is an issue for all other file fields in Civi. And doing the minor change in tpl we can atleast show the uploaded filename against that field.


@monishdeb
Copy link
Member Author

@eileenmcnaughton
Copy link
Contributor

Code looks OK if anyone is up to test it out

@Edzelopez
Copy link
Contributor

I tested the file upload functionality using various file types (pdf, xls, jpg...) and it seems to work well with all of them, rendering thumbnails for images and links for the others
test

After a validation error, the file field is wiped out (as expected), but the text "Attached " may give one the impression that the file is attached successfully. Could we maybe change this text to something more appropriate?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor

I think this is good to merge once @Edzelopez's issue is addressed & test is confirmed to be unrelated

@monishdeb
Copy link
Member Author

@eileenmcnaughton @Edzelopez I would treat that file-lost-on-validation-error as a separate issue because that is happening with all core/custom file fields and here's the issue for that https://issues.civicrm.org/jira/browse/CRM-16474 Also CRM-21654 is a paid issue and the client wants to just support the custom file upload in Batch entry form.

However, I still tried to fix CRM-16474 but it will take more time as the problem lies in Quickform inability to handle file uploads as a default but I can assure that the fix would be general and will applicable to all kinds of file field.

What do you say?

@eileenmcnaughton
Copy link
Contributor

@Edzelopez I haven't gotten my head into this - I'm happy to merge if you are satisfied. Also pinging @yashodha who seems to have been touching a lot of batch related UI issues

@Edzelopez
Copy link
Contributor

I think as long as we are addressing the issue of the lost file upload on validation separately, we are good. Could you please merge if everything else looks okay @eileenmcnaughton ?
Thanks!

@lcdservices
Copy link
Contributor

I've tested this patch and it's working as expected. I agree we should move forward with this and handle the pre-existing validation issue separately.

@eileenmcnaughton
Copy link
Contributor

Thanks - merging on @lcdservices & @Edzelopez endorsement. I acknowledge they may be interested parties in this but it's a minor bug fix rather than an improvement with many considerations.

@eileenmcnaughton eileenmcnaughton merged commit 0e51fc7 into civicrm:master Feb 13, 2018
@mlutfy mlutfy added this to the 4.7.31 milestone Mar 6, 2018
@marcusjwilson
Copy link

marcusjwilson commented Apr 25, 2020

Any further update on whether point 2 here was ever addressed? From what I see, if a Profile form with a file upload field has a non-inline Validation error (i.e. the page reloads rather than errors inline) then any file previously uploaded to the form is lost, without a warning to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants