wintercms / wintercms/winter

Make errors in components show the correct path

Open
#439 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs response
Dominant language
PHP
Stars
1.5k
Forks
246
Avg merge
19h 2m
Merged PRs (30d)
7

Description

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'];
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the component error using the shown MyClass and the pages/photos.htm entry point, then inspect how the error page and stack trace resolve component source locations. Done means the error output identifies the actual component file and line that caused the failure rather than only the including page.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.