Skip to content

Site is not cleared from yaml and field after a site is deleted from Craft #264

@mariuswestgaard

Description

@mariuswestgaard

Describe the bug

I have a few hyper fields where I can select multiple sites. The issue arise when a site is deleted from Craft. There's two issues.

  1. In yaml, all the site uids are stored, and is not updated when a site is deleted. I then get a Missing site error message in hyper field in editor.
  2. I then manually removed the site uid from yaml file, touched the project config, and applied the changes. After this, the field error goes away, but, the selected value still holds the site uid, so in GraphQL I had the same Missing site error when querying that field which had the site.

Steps to reproduce

  1. Create a multisite, and a section with a hyper field with multiple links and Site setting enabled
  2. Create an entry and add all sites to the field in editor.
  3. Delete one of the sites from CMS. First issue should arise now.
  4. Manually remove the site uid of deleted site from the yaml-file, and run craft project-config/touch and apply the changes.
  5. Now query the field with gql. It should still return missing site error.
  6. Remove the element in the field which had the site. Save.
  7. The gql error should now go away.

Craft CMS version

5.8.17

Plugin version

2.2.9

Multi-site?

Yes

Additional context

No response

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