Skip to content

Neo loses content when the plugin gets removed via projectConfig #1040

Description

@hiasl

Bug Description

@krafttoast and I found out the following:

  • When you uninstall Neo locally its fields get migrated to matrix and the content stays.
  • When you deploy this removal to production where Neo gets removed via projectConfig, the fields are migrated but the content gets lost

Steps to reproduce

1.) Prepare the initial system

  • Take a fresh installation of Craft 5 with Neo 5
  • environment should be dev and allowAdminChanges = true
  • Create a very simple Neo field with one block only
  • Prepare one sample entry with this Neo field having some content
  • Create a DB backup and commit a GIT branch "initial"

2.) Manually remove NEO and validate ex-NEO content

  • Remove NEO via the console: ddev plugin/uninstall neo
  • Check your content: the NEO field was migrated to matrix, the content is still there
  • commit your projectConfig to a new GIT branch "noneo"

3.) Remove NEO via projectConfig

  • Switch the GIT back to initial and restore the DB backup from above
  • Change .env to environment production and make sure allowAdminChanges = false
  • When you log into the CP the entry with the sample NEO content should be there, no projectConfig diffs.
  • Now switch to the "noneo" branch and do a craft up
  • Neo gets uninstalled, the field is migrated to matrix, but the content is lost
  • Interestingly also project.yaml gets a new modification date (although allowAdminChanges is false) and some minor changes are made in the field's yaml and project.yaml regarding UID comments.

We tried this on our full project as well as on a local, naked sample installation.

Expected behaviour

The content should survice NEOs removal.

Neo version

5.5.12

Craft CMS version

5.10.12

DB

PostgreSQL: 16

What is the affected Neo field's propagation method?

No response

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions