spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
402 stars 63 forks source link

All Neo blocks lost when GC runs #725

Closed ccchapman closed 1 year ago

ccchapman commented 1 year ago

What happened?

Description

Garbage collection (GC) is causing structures to be flattened and Neo blocks to disappear.

Steps to reproduce

  1. Site contains a structure
  2. Structure is populated with nested entries
  3. Entry type has Neo field with Neo blocks
  4. Run craft gc/run (I say no to trashed)
  5. Run craft gc/run again (Say no to trashed again)

Expected behavior

Content is impacted

Actual behavior

Reproduced on multiple attempts and multiple projects. Could not reproduce when Neo is disabled.

Could not reproduce on a fresh install of Craft.

Craft CMS version

4.4.3

PHP version

8.1

Operating system and version

No response

Database type and version

PostgreSQL 14.3, PostgreSQL 14.5

Image driver and version

No response

Installed plugins and versions

Composer info from project 1
craftcms/aws-s3                            2.0.1            Amazon S3 integration for Craft CMS
craftcms/cms                               4.4.1            Craft CMS
craftcms/feed-me                           5.0.5            Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.
craftcms/redactor                          3.0.3            Edit rich text content in Craft CMS using Redactor by Imperavi.
hybridinteractive/craft-position-fieldtype v4.x-dev e0c05bb Brings back the Position fieldtype from Craft 2
korcontrol/craft-classy                    2.0.0            Twig helpers inspired by https://github.com/JedWatson/classnames
mutation/translate                         3.0.1            Translate messages in the control panel
nystudio107/craft-closure                  1.0.0            Allows you to use arrow function closures in Twig
nystudio107/craft-retour                   4.1.11           Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website
nystudio107/craft-seomatic                 4.0.20           SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
nystudio107/craft-vite                     4.0.5            Allows the use of the Vite.js next generation frontend tooling with Craft CMS
putyourlightson/craft-blitz                4.4.3            Intelligent static page caching for creating lightning-fast sites.
sebastianlenz/linkfield                    2.1.5            A Craft field type for selecting links
spacecatninja/imager-x                     4.1.11           Ninja powered image transforms.
spicyweb/craft-embedded-assets             3.1.1            Manage YouTube videos, Instagram photos, Twitter posts and more as first class assets
spicyweb/craft-neo                         3.7.0            A Matrix-like field type that uses existing fields
topshelfcraft/environment-label            4.0.2            ...so you don't forget where you are.
topshelfcraft/wordsmith                    4.2.0            ...because you have the best words.
verbb/navigation                           2.0.16           Create navigation menus for your site.
vlucas/phpdotenv                           v5.5.0           Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
yiisoft/yii2-redis                         2.0.18           Redis Cache, Session and ActiveRecord for the Yii framework
yiisoft/yii2-shell                         2.0.5            The interactive shell extension for Yii framework
Composer info from project 2
algolia/algoliasearch-client-php 3.3.2  Algolia Search API Client for PHP
craftcms/aws-s3                  2.0.3  Amazon S3 integration for Craft CMS
craftcms/cms                     4.4.3  Craft CMS
craftcms/feed-me                 5.1.0  Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.
craftcms/redactor                3.0.4  Edit rich text content in Craft CMS using Redactor by Imperavi.
diginov/craft-sentry-logger      4.1.1  Pushes Craft CMS logs to Sentry through a real Yii 2 log target
doublesecretagency/craft-cpcss   2.6.0  Add custom CSS to your Control Panel.
ether/simplemap                  v4.0.3 A beautifully simple Map field type for Craft CMS
nystudio107/craft-retour         4.1.11 Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website
nystudio107/craft-seomatic       4.0.22 SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 4. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
sebastianlenz/linkfield          2.1.5  A Craft field type for selecting links
spacecatninja/imager-x           4.1.11 Ninja powered image transforms.
spicyweb/craft-batch-actions     1.3.0  A Craft CMS plugin for performing batch actions on Matrix and Neo blocks
spicyweb/craft-embedded-assets   3.1.1  Manage YouTube videos, Instagram photos, Twitter posts and more as first class assets
spicyweb/craft-neo               3.4.1  A Matrix-like field type that uses existing fields
studioespresso/craft-scout       3.1.0  Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
verbb/formie                     2.0.24 The most user-friendly forms plugin for Craft.
verbb/navigation                 2.0.16 Create navigation menus for your site.
verbb/workflow                   2.0.4  Create a workflow for publishing entries.
vlucas/phpdotenv                 v5.5.0 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
yiisoft/yii2-redis               2.0.18 Redis Cache, Session and ActiveRecord for the Yii framework
yiisoft/yii2-shell               2.0.5  The interactive shell extension for Yii framework
ccchapman commented 1 year ago

Determined this does not appear to be Neo specific and opened https://github.com/craftcms/cms/issues/12925 instead.

ccchapman commented 1 year ago

I am reopening this issue as it was determined the issue cannot be reproduced when Neo is disabled or on a fresh install of Craft CMS.

brandonkelly commented 1 year ago

This ended up being a Craft 3.8/4.4 bug, fixed now in 3.8.4 and 4.4.4.