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

Add an explicit error if an invalid yaml format is detected #7

Open
chrispenny opened this issue Nov 5, 2024 · 0 comments · May be fixed by #8
Open

Add an explicit error if an invalid yaml format is detected #7

chrispenny opened this issue Nov 5, 2024 · 0 comments · May be fixed by #8
Labels
enhancement New feature or request

Comments

@chrispenny
Copy link
Contributor

chrispenny commented Nov 5, 2024

This is the correct format, whereby you can set options.type: number:

SilverStripe\Forager\Service\IndexConfiguration:
  indexes:
    main:
      includeClasses:
        SilverStripe\CMS\Model\SiteTree:
          fields:
            title: true
            parent_id:
              property: ParentID
              options:
                type: number

If a developer accidentally forgets the options parent object, then there is no error to indicate that something is about to go wrong, and that they will be about to define their field as type: text (or whatever the default field type is for the plugin module).

EG: This is an incorrect format, which will result in an unexpected field type:

SilverStripe\Forager\Service\IndexConfiguration:
  indexes:
    main:
      includeClasses:
        SilverStripe\CMS\Model\SiteTree:
          fields:
            title: true
            parent_id:
              property: ParentID
              type: number
@chrispenny chrispenny added the enhancement New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant