Changing type of Homepage-node causes Footer to throw an exception

I’m creating a website based on the NeosDemo site-package in Neos 2.0.

For page variety, I created alternate page-node-types and layouts for those new page-nodes, so I can change design on the fly.

However, whenever I try to change the root page type from “Homepage” to anything else, the footer throws an exception:

An exception was thrown while Neos tried to render your page. No
content collection of type TYPO3.Neos:ContentCollection could be found 
in the current node and no node path was provided. You might want to 
configure the nodePath property with a relative path to the content 
collection.
landingPage  <TYPO3.Neos:Page>/
 body<TYPO3.TypoScript:Template>/
  footer/
   __meta/
    context/
     node<>/
For a full stacktrace, open Data/Logs/Exceptions/201510070855367ea0e9.txt

I can’t figure out where the footer content is being provided so it can be rendered.
Any idea on what to do?

Sounds like you’re missing some auto created content collections after changing the node type structure. Try running ./flow node:repair.

that results in this:

Generate missing URI path segments

PHP Fatal error:  Call to a member function getChildNodes() on a non-object in 
./Neos-2.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes
/TYPO3_Neos_Command_NodeCommandControllerPlugin.php on line 124

I seem to get that every time, even with the root page node set to Homepage.
Flushed cache beforehand, too.

Also, after changing the page type and publishing it and then changing it back, the content inside the footer contentcollection is gone.

ok, i figured the footer part out. I needed this part in the NodeTypes.yaml for every node that can work as a “Homepage” :

  childNodes:
    'footer':
      position: 'end'
      type: 'TYPO3.Neos:ContentCollection'
      constraints:
        nodeTypes:
          '*': FALSE
          'TYPO3.Neos.NodeTypes:Headline': TRUE
          'TYPO3.Neos.NodeTypes:Text': TRUE
          'TYPO3.Neos.NodeTypes:Image': TRUE

now I need to figure out why my Neos doesn’t do node-repair.

Sounds like you have a broken node data table. It cannot find the node with the path /sites, although there should be a check to prevent the fatal error. You should have at least two nodes in your node data table like these:

INSERT INTO `typo3_typo3cr_domain_model_nodedata` (`persistence_object_identifier`, `workspace`, `contentobjectproxy`, `path`, `identifier`, `sortingindex`, `properties`, `nodetype`, `removed`, `hidden`, `hiddenbeforedatetime`, `hiddenafterdatetime`, `hiddeninindex`, `accessroles`, `version`, `parentpath`, `pathhash`, `dimensionshash`, `dimensionvalues`, `parentpathhash`, `movedto`, `creationdatetime`, `lastmodificationdatetime`, `lastpublicationdatetime`)
  VALUES
('fa995938-16aa-11ba-c696-d77a8ae3f845', 'live', NULL, '/', '352af71b-e17f-b063-1215-b1bdf035961c', NULL, '{}', 'unstructured', 0, 0, NULL, NULL, 0, '[]', 2, '', '6666cd76f96956469e7be39d750cc7d9', 'd751713988987e9331980363e24189ce', '[]', 'd41d8cd98f00b204e9800998ecf8427e', NULL, '2015-07-31 19:36:07', '2015-07-31 19:36:07', NULL),
('af6e8d6a-ca43-7ee4-f655-fbf2cd85b198', 'live', NULL, '/sites', '5df2948d-435f-01ed-4626-043608e2265e', 100, '{}', 'unstructured', 0, 0, NULL, NULL, 0, '[]', 1, '/', 'dbd87ae51cbf5240fea77283585e69d5', '4f534b1eb0c1a785da31e681fb5e91ff', '{\n    \"language\": {\n        \"0\": \"en_US\"\n    }\n}', '6666cd76f96956469e7be39d750cc7d9', NULL, '2015-07-31 19:36:07', '2015-07-31 19:36:07', NULL);

Might be a bit different depending if you’re using content dimensions or not.

1 Like

Pushed a fix for the fatal error https://github.com/neos/neos-development-collection/pull/122

After

SELECT * FROM 5neos2_site1.typo3_typo3cr_domain_model_nodedata
where path = '/' OR path = '/sites'

I get this:

INSERT INTO `typo3_typo3cr_domain_model_nodedata` 
(`persistence_object_identifier`,`workspace`,`contentobjectproxy`,`path`,`identifier`,`sortingindex`,`properties`,`nodetype`,`removed`,`hidden`,`hiddenbeforedatetime`,`hiddenafterdatetime`,`hiddeninindex`,`accessroles`,`version`,`parentpath`,`pathhash`,`dimensionshash`,`dimensionvalues`,`parentpathhash`,`movedto`,`creationdatetime`,`lastmodificationdatetime`,`lastpublicationdatetime`)
VALUES 
('179d62e4-7e65-6283-177b-b3401db585c0','live',NULL,'/sites','61993507-1db6-bdc8-2643-801b5de77b75',100,'{\n\n}','unstructured',0,0,NULL,NULL,0,'[]',1,'/','dbd87ae51cbf5240fea77283585e69d5','4f534b1eb0c1a785da31e681fb5e91ff','{\"language\":[\"en_US\"]}','6666cd76f96956469e7be39d750cc7d9',NULL,'2015-09-22 16:15:48','2015-09-22 16:15:48',NULL),
('297e9518-c1c9-b522-3f49-d71d0a651fe3','user-admin',NULL,'/','2669b42a-3278-9885-38f4-857944ba181a',NULL,'{\n\n}','unstructured',0,0,NULL,NULL,0,'[]',2,'','6666cd76f96956469e7be39d750cc7d9','d751713988987e9331980363e24189ce','[]','d41d8cd98f00b204e9800998ecf8427e',NULL,'2015-09-22 16:16:38','2015-09-22 16:16:38',NULL)
('3ee87e77-7b3e-916a-12c9-fc9bf135e380','live',NULL,'/','3aa62896-802b-2155-8f57-3792803d14f6',NULL,'{\n\n}','unstructured',0,0,NULL,NULL,0,'[]',2,'','6666cd76f96956469e7be39d750cc7d9','d751713988987e9331980363e24189ce','[]','d41d8cd98f00b204e9800998ecf8427e',NULL,'2015-09-22 16:15:48','2015-09-22 16:15:48',NULL);

after applying your patch:

sudo ./flow node:repair

Run several operations to ensure the node integrity

Checking for nodes with abstract or undefined node types …
Checking for orphan nodes …
Found orphan node named “node-56029b6145cea” (TYPO3.Neos.NodeTypes:Page) in “/sites/neosdemotypo3org/node-560e47b05e66c/node-56029b6145cea”

Do you want to remove all orphan nodes? (y/n)y

Removed 1 orphan node.

Checking for disallowed child nodes …
Checking for undefined properties …
Checking for missing child nodes …
Checking for child nodes that needs reordering …
Moved node named “teaser” after node named “main” in "/sites/neosdemotypo3org"
Checking for missing default values …

Generate missing URI path segments

Could not find “/sites” root node

Node repair finished.

Database query result is stays the same.

And I can’t login to the backend anymore, which is kinda weird … it accepts my credentials, but then redirects me to the login screen again.

I think flow is serious about me not having a root node.

ok, i checked the log and it was a file permission error. I did a

sudo ./flow core:setfilepermissions user www-data www-data
and I can login again.

still have the missing “/sites” root node, but neos doesn’t seem to care.

Had to dig a bit deeper to figure out why it’s not working. Basically it’s a bug in the core related to a missing content dimension record in the database.

Try inserting this record:

 INSERT INTO `typo3_typo3cr_domain_model_nodedimension` (`persistence_object_identifier`, `nodedata`, `name`, `value`)
  VALUES
('977bccbf-e1dc-85ef-9288-42819cde797f', '179d62e4-7e65-6283-177b-b3401db585c0', 'language', 'en_US');

Here’s an example of the query it does to find the /sites node:

SELECT t0_.persistence_object_identifier AS persistence_object_identifier0, t0_.version AS version1, t0_.pathhash AS pathhash2, t0_.path AS path3, t0_.parentpathhash AS parentpathhash4, t0_.parentpath AS parentpath5, t0_.identifier AS identifier6, t0_.sortingindex AS sortingindex7, t0_.removed AS removed8, t0_.dimensionshash AS dimensionshash9, t0_.lastmodificationdatetime AS lastmodificationdatetime10, t0_.lastpublicationdatetime AS lastpublicationdatetime11, t0_.hiddenbeforedatetime AS hiddenbeforedatetime12, t0_.hiddenafterdatetime AS hiddenafterdatetime13, t0_.dimensionvalues AS dimensionvalues14, t0_.properties AS properties15, t0_.nodetype AS nodetype16, t0_.creationdatetime AS creationdatetime17, t0_.hidden AS hidden18, t0_.hiddeninindex AS hiddeninindex19, t0_.accessroles AS accessroles20, t0_.workspace AS workspace21, t0_.contentobjectproxy AS contentobjectproxy22, t0_.movedto AS movedto23 FROM typo3_typo3cr_domain_model_nodedata t0_ WHERE t0_.workspace IN ('live') AND (t0_.persistence_object_identifier IN (SELECT t1_.nodedata AS sclr24 FROM typo3_typo3cr_domain_model_nodedimension t1_ WHERE t1_.name = 'language' AND t1_.value IN ('en_US'))) AND t0_.pathhash = 'dbd87ae51cbf5240fea77283585e69d5'

Can’t insert the record because it’s already there.

Could this error be language related? Because I edited the Settings.yaml to use ‘de’ as main language and ‘en_US’ as secondary.

TYPO3CR:
    contentDimensions:
      'language':
        label: 'TYPO3.NeosDemoTypo3Org:Main:contentDimensions.language'
        icon: 'icon-language'
        default: 'de'
        defaultPreset: 'de'
        presets:
          'all': ~
          'de':
            label: 'German'
            values: ['de']
            uriSegment: 'de'
          'en_US':
            label: 'English'
            values: ['en_US']
            uriSegment: 'en'

It sure can. When doing that you need to migrate your content. The documentation might help http://neos.readthedocs.org/en/stable/HowTos/TranslatingContent.html#migration-of-existing-content + http://neos.readthedocs.org/en/stable/CreatingASite/ContentDimensions.html. Also there are some additional migrations available in the core.

will try tomorrow.
thanks for all your effort.

So, the first thing I tried was to set the default language back to en_US.
After that, node repair worked without a hitch.

Then I changed default language to ‘de’ again, followed by

> ./flow node:migrate 20140326143834

Comments
  Migrate from no node dimensions to default dimension values.

Successfully applied migration.


> ./flow node:repair
Generate missing URI path segments

Could not find "/sites" root node

Run several operations to ensure the node integrity

Checking for nodes with abstract or undefined node types ...
Checking for orphan nodes ...
Checking for disallowed child nodes ...
Checking for undefined properties ...
Checking for missing child nodes ...
Checking for child nodes that needs reordering ...
Checking for missing default values ...

Node repair finished.

>./flow configuration:validate
Validating all configuration

All Valid!

doesn’t seem to have any consequences, though.

Thanks @aertmann, i also had the Could not find "/sites" root node error when running node:repair and manually adding the /site entry into the typo3_typo3cr_domain_model_nodedimension table did the trick. Furthermore serveral root nodes within typo3_typo3cr_domain_model_nodedimensionhad empty values in the dimensionvalues column ({} or []) (also had to create entries for them in typo3_typo3cr_domain_model_nodedimension).

@Aroddo: It does have consequences if the /sites root node is not set properly!
For example $this->context->getRootNode()will not work.

I met the same problem, in my site the the footer can workers well when the lanfuage is"en_US", but failed in the “zh_CN”,
An exception was thrown while Neos tried to render your pageNo
content collection of type TYPO3.Neos:ContentCollection could be found
in the current node and no node path was provided. You might want to
configure the nodePath property with a relative path to the content
collection.verticalPageTYPO3.Neos:Page/
bodyTYPO3.TypoScript:Template/
footer/
__meta/
context/
node<>/For a full stacktrace, open Data/Logs/Exceptions/20160107104314913c90.txt

I don’t konw how to solve it. I need your help and advice.

1 Like