winter: Make errors in components show the correct path

Winter CMS Build

1.1

PHP Version

7.4

Database engine

SQLite

Plugins installed

No response

Issue description

If you have an error in a component, the error page does not give any indication of which actual line of code is producing the error either in the error message or the stack trace.

For example:

image

The line given (/www/themes/myTheme/pages/photos.htm line 133) is simply the line where the component is being included into the page. The actual line producing the error can literally be anywhere.

Steps to replicate

This happened to me when I had a model that implemented TranslatableModel, but didn’t define a $translatable property.

class MyClass extends Model
{
    // ...
    public $implement = ['@Winter.Translate.Behaviors.TranslatableModel'];

    // public $translatable = ['images'];
}

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

Yes, I’ll be working on finishing up support for Laravel 9 this week.