Skip to content

A file with multiple "unknown custom theme setting errors" only shows one at a time #573

@troyciesco

Description

@troyciesco

Issue summary

While learning how to build a theme, I was taking things from Casper and Source and editing them just to see how things work. The error messages in the sidebar were very helpful, but as I was going through and fixing them I noticed that if a file had a custom theme setting error it would only show the first one.

For example, in my index.hbs I have @custom.demo_prop_on_index_1 and @custom.demo_prop_on_index_2. Neither actually exist in the config in package.json, so I'd expect to see an error for both. However, I just see the first one (same for the other files):

Image

When I remove that piece of code and check the scan again, only now do I see the second error:

Image

In addition, in a large file it can be a bit difficult to find where the error is because there's no line number.

Steps to reproduce

  • You'll need a theme with files that're using custom theme settings that aren't actually defined in package.json. I created an example here: https://github.com/troyciesco/ghost-skeleton and here's a zip: ghost-skeleton.zip. Basically you want the file(s) to have multiple unknown custom theme setting errors.
  • Check the scan using the web tool, directly in a ghost instance, or with --verbose in the CLI. You'll only see the first error for each file.
    • using the CLI without verbose will give you a comma delimited list of files with each file being listed only once, which i think makes sense.

Proposed Solution (see PR)

  • Display each error for each file, with a line number showing where the error happened (i.e. "L8")
  • ensure the regular CLI version still displays a comma delimited list that only shows each file once

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions