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

Fix test. Don't hide errors. (Followup to 23999) #24007

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

demeritcowboy
Copy link
Contributor

Overview

See #23999 (comment)

Before

Recent change hides errors, but the only time there would be an error is when it really is an error.

After

Errors when there are errors.

Technical Details

When calling this function, there's never a time $message should be null. It's either coming from:

  • The form values, in which case it's never null.
  • Some other backend code, in which case if it's null it's a coding error since then what is the resulting pdf supposed to contain? (This is the situation with the test.)
  • The converted uploaded doc/odt file for the message template, in which case if it's null there's a problem with the file, which is also an error.

So the error is helpful to tell you there's a problem.

Comments

To truly see the test pass/fail you would need php 8.1, since that's what the original PR was about.

@civibot
Copy link

civibot bot commented Jul 17, 2022

(Standard links)

@civibot civibot bot added the master label Jul 17, 2022
@demeritcowboy demeritcowboy mentioned this pull request Jul 17, 2022
@seamuslee001
Copy link
Contributor

works for me

@seamuslee001 seamuslee001 merged commit 11302a9 into civicrm:master Jul 18, 2022
@demeritcowboy
Copy link
Contributor Author

Thanks!

@demeritcowboy demeritcowboy deleted the pdf-error branch July 18, 2022 03:05
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