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

Ensure we don't throw a fatal error if composer isn't set up correctly #740

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Mar 6, 2024

Description of the Change

We have some code that outputs an error message if composer hasn't been set up correctly but this code has a bug in it that ends up causing a fatal error instead. This PR fixes that issue and also removes the translation of this error message as no real need to translate strings that end up in the error log.

How to test the Change

  1. On the develop branch, clone the repo but don't run composer install
  2. Activate the plugin and notice a fatal error happens
  3. Run composer install and notice the error goes away
  4. Checkout this branch and remove the vendor directory
  5. Notice the fatal error doesn't happen anymore but an admin error notice shows instead

Changelog Entry

Fixed - Fix a fatal error that occurs if composer install hasn't been run

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 3.0.1 milestone Mar 6, 2024
@dkotter dkotter self-assigned this Mar 6, 2024
@dkotter dkotter marked this pull request as ready for review March 6, 2024 16:33
@dkotter dkotter requested review from jeffpaul and a team as code owners March 6, 2024 16:33
@dkotter dkotter requested review from peterwilsoncc and removed request for a team and jeffpaul March 6, 2024 16:33
@github-actions github-actions bot added the needs:code-review This requires code review. label Mar 6, 2024
@peterwilsoncc peterwilsoncc linked an issue Mar 7, 2024 that may be closed by this pull request
1 task
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a note about it being a warning rather than an error.

Internationalization has been removed, was that intentional or did you just wish to get rid of the escaping?

classifai.php Outdated Show resolved Hide resolved
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
@dkotter
Copy link
Collaborator Author

dkotter commented Mar 7, 2024

Internationalization has been removed, was that intentional or did you just wish to get rid of the escaping?

Yeah, mentioned this in the PR description (though realize that's easy to miss) but my view was this is a message meant to be in the error log so doesn't seem like there's any real need to translate that. It's easy enough to add back though if you feel like it should be there.

@peterwilsoncc peterwilsoncc merged commit 378e225 into develop Mar 7, 2024
13 checks passed
@peterwilsoncc peterwilsoncc deleted the fix/composer-error branch March 7, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error: Missing format specifier at end of string in classifai.php:91
2 participants