neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 221 forks source link

Nodes with invalid dimension values after fresh installation #1967

Closed putzwasser closed 6 years ago

putzwasser commented 6 years ago

Description

Neos creates three nodes during the setup.

  1. /sites/
  2. /sites/vendor-site
  3. /sites/vendor-site/main

It adds to /sites/vendor-site and /sites/vendor-site/main a content dimension: {"language":["en_US"]}. But that dimension isn't configured by default.

If you run ./flow node:repair it will find those two nodes with an invalid dimension value and asks you, if you want to remove them. If you say yes, neos will delete your freshly created site nodes.

The real problem is: If you don't care about configuring a dimension, build your site, run node:repair at some point and delete the site node, you will destroy your site, because all childnodes become orphaned and node:repair will suggest you to delete them as well.

./flow node:repair
Run checks for basic node integrity in the content repository

Checking for nodes with abstract or undefined node types ...
Checking for orphan nodes ...
Checking for disallowed child nodes ...
Checking for undefined properties ...
Checking for broken entity references ...
Checking for nodes with invalid dimensions ...
Node /sites/vendor-site has invalid dimension values: {"language":["en_US"]}
Node /sites/vendor-site/main has invalid dimension values: {"language":["en_US"]}

Nodes with invalid dimension values found.
You might solve this by migrating them to your current dimension configuration or by removing them.
Do you want to remove 2 nodes with invalid dimensions now? (y/n)

Steps to Reproduce

  1. Install a plain neos copy
  2. Add some (document) nodes
  3. run ./flow node:repair

Affected Versions

Testet: Neos: 3.3.8

Probably at least some previous versions as well (didn't test)

iseries commented 6 years ago

ran into the same problem because i wanted a page with only 1 content dimension. After an hour i found a (dirty) way.

After install neos and creating a new sitepackage I was editing the settings like: Neos: ContentRepository: contentDimensions: 'language': default: 'de' defaultPreset: 'de' label: 'Language' icon: 'icon-language' presets: 'de': label: 'German' values: ['de'] uriSegment: ''

...and changed all entries with en_US to de in table _neos_contentrepository_domain_modelnodedata
and _neos_contentrepository_domain_modelnodedimension

./flow node:migrate 20150716212459 didn't work for me

kitsunet commented 6 years ago

Those dimensions are not configured by default but rather come from the demo site. Ideally you don't install the demo site in your installation and start with no site package. Then the setup should generate correct nodes.

iseries commented 6 years ago

Strange... When install a fresh neos and create a new site package with a dummy site, the entries are in the table by default after step 4 in setup: image The Neos.Demo package is rightly gone after complete the setup.

//Edit: removed neos.demo from composer.json before setup and all works fine.