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

[REF] Copy preProcessFromAddress back into the pdf function #21306

Merged
merged 1 commit into from
Aug 29, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

REF Copy preProcessFromAddress back into the pdf function

Before

We are calling a function on another class that is slated for deprecation. It's really hard to unravel that function with it being called from 3 places & parts of it relating to different places

After

It is copied back for cleanup

Technical Details

This is really hard to unravel without splitting it between classes -
mostly because it does stuff to do with setting properties on the form
that are not even relevant to all forms. This is a divide & conquer
case to cleaning up the function from
the deprecated class

Note that I removed the bounce on no-email. It felt like we would still want
to be able to download pdfs if the logged in user had no email. The bounce param seems
to have been added as an after thought - presumably to block
the bounce in a flow where they realised it made no sense

Comments

This is really hard to unravel without splitting it between classes -
mostly because it does stuff to do with setting properties on the form
that are not even relevant to all forms. This is a divide & conquer
case to cleaning up the function from
the deprecated class

Note that I removed the bounce on no-email. It felt like we would still want
to be able to download pdfs if the logged in user had no email. The bounce param seems
to have been added as an after thought - presumably to block
the bounce in a flow where they realised it made no sense
@civibot
Copy link

civibot bot commented Aug 29, 2021

(Standard links)

@civibot civibot bot added the master label Aug 29, 2021
@eileenmcnaughton eileenmcnaughton changed the title REF Copy preProcessFromAddress back into the pdf function [REF] Copy preProcessFromAddress back into the pdf function Aug 29, 2021
@demeritcowboy
Copy link
Contributor

This seems ok.

It might be slightly cleaner to put the code inside a separate function rather than dumping into preProcess - or are you going to move some of this again in a minute?

The bounce param seems to have been added as an after thought - presumably to block the bounce in a flow where they realised it made no sense

It would probably be for thank-you letters where the From field is required, but yes it probably shouldn't be required if you just want to download, and it would be a very unusual install anyway where the logged-in user and the system have no From emails configured. I'd be curious how many users have ever seen the bounce message.

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy I didn't put it in it's own function because I don't think it's the right grouping on functionality - but I have been thinking about this line

https://github.com/civicrm/civicrm-core/pull/21306/files#diff-42159e86480cd91ed6b03047d5b1e17abe32fd21ca2233c4788b0374924894dfR54

And I'm increasingly sure that it only exists to support the invoice code (& is used by a test out of convenience) - I can't think of any logical reason to set it to logged in user on the pdf class - although I had thought removing it was something I'd do once this is merged

@demeritcowboy demeritcowboy merged commit 5676884 into civicrm:master Aug 29, 2021
@demeritcowboy
Copy link
Contributor

Ok thanks.

@eileenmcnaughton eileenmcnaughton deleted the prepro branch August 29, 2021 23:11
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.

2 participants