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

Undefined variable $e in console/Application.php:83 #7309

Closed
jellingsen opened this issue Dec 21, 2020 · 2 comments
Closed

Undefined variable $e in console/Application.php:83 #7309

jellingsen opened this issue Dec 21, 2020 · 2 comments
Labels
bug severity:normal Bugs that affect typical usage

Comments

@jellingsen
Copy link

Description

We start our local development environment with docker by running docker-compose up, and we have a queue-worker that is running php craft migrate/all during startup.
For some reason the action fails (might be that the database is not yet fully initialized), but the error is:

PHP Notice 'yii\base\ErrorException' with message 'Undefined variable: e'

in /srv/vendor/craftcms/cms/src/console/Application.php:83

Now this happens because the Console::outputWarning()-function is called outside the try-catch, and for some reason the SQL-query inside the try block does not fail, and the exception is not actually set.

Steps to reproduce

This might be hard to reproduce, but the code should check if the exception variable is set before using it in the output.

Additional info

  • Craft version: Craft Pro 3.5.15.1
  • PHP version: 7.4.2
  • Database driver & version: MySQL 5.7.31
@brandonkelly brandonkelly added bug severity:normal Bugs that affect typical usage labels Dec 31, 2020
@brandonkelly
Copy link
Member

Thanks for reporting that. Fixed for the next release.

@brandonkelly
Copy link
Member

Craft 3.5.18 is out now with that fix ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug severity:normal Bugs that affect typical usage
Projects
None yet
Development

No branches or pull requests

2 participants