Neos 9: node.backReferences empty in frontend

Hello

I use the same site package on different pages. Since it only does not work on one site, I assume that I have a problem somewhere in the configuration or in the database. Note: I have to rename the name of the site node once (maybe that’s the reason)?

I have a node that uses BackReferences:

prototype(XYZ) < prototype(Neos.Neos:ContentComponent) {
<Neos.Fusion:Loop items={q(documentNode).backReferences('modul').get()} itemName='modulAufgabe' iterationName="aufgabeIterator">
...
</Neos.Fusion:Loop>
}

Everything works as it should in the Neos backend. In the frontend, however, BackReferences returns an empty array. The problem also occurs with other NodeTypes, which work smoothly on other pages. Does anyone have an idea what I can do? I do not see any exceptions.

Best,
Jan

Does nobody really have any idea how I can fix this? … or what’s the reason for this behaviour? :frowning:

What would you recommend to do? Maybe create a blank site, copy my event-db-entries and resource-files in there and try to replay all?

Hi @jan82,

we need to have a closer look into this. It is strange, that it works partially.

Can you explain, how you renamed the site node?

Hey Denny

Thx for your post. Do you want to see my instance? Or do you like an export?

Best,
Jan

PS:
I change the Root sitenode using the backend UI. Afterwards I adjusted the event columns metadata and properties, which referenced to the old sitenode name. The backend reprentation worked without problems.

hi i dont really understand your situation yet.

I assume you have two or more Neos sites using one site package. Do they all run in the ‘default’ content repository?

These informations might be helpful to us:

flow configuration:show --path Neos.Neos.sites

and

flow site:list

(NOTE that FlowQueries only operate inside the same content repository)


Okay and then you mentioned something about renaming the site? What do you mean with that exactly? Why did you adjust that? And why did you modify the events? Could you please elaborate a little more on that? That might very well be the reason for that you system behaves different now. (The event store is holy:D)

Hi

The situation is, that my site works perfectly fine in the backend, but not in the frontend. Just an visual example:

And that’s the Frontend:

The method backReferences(‘modul’).get() return an empty array in the frontend, in the backend it’s working.

Yesterday I realized, hat even the “main” at the site page is not rendered correctly in the frontend, but in the backend.

I have multiple sites but was asked to keep them 100% independent after I started setting everything up.

> ./flow configuration:show --path Neos.Neos.sites
> Configuration "Settings: Neos.Neos.sites":
> 
> '*':
>     preset: default
>     contentDimensions:
>         defaultDimensionSpacePoint:
>             language: de
>         resolver:
>             factoryClassName: Neos\Neos\FrontendRouting\DimensionResolution\Resolver\UriPathResolverFactory
>             options:
>                 segments:
>                     -
>                         dimensionIdentifier: language
>                         dimensionValueMapping:
>                             de: de
>                             fr: fr
>                             it: it
>                             en: en

and

/opt/php82/bin/php ./flow site:list
±-----------±----------±-----------------±-------+
| Name | Node name | Resource package | Status |
±-----------±----------±-----------------±-------+
| HERMES VBS | hermes | ICTpark.Hermes | online |
±-----------±----------±-----------------±-------+

The node name was “hermes-vbs” when I started. I changed it to have the same site node name everywhere, although the sites are completly independent.

I changed the name of the site node in the UI and then changed the nodename everywhere in the DB where I could find it and did a replayall:

events-payload:

{"workspaceName":"live","contentStreamId":"52f2294d-3e87-4ab7-95f3-c3ebb81fb5d2","nodeAggregateId":"11fac35c-7811-4462-a8b4-48aff0982985","nodeTypeName":"ICTpark.Hermes:Document.Homepage","originDimensionSpacePoint":{"language":"de"},"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":{"language":"de"},"nodeAggregateId":null}],"parentNodeAggregateId":"97887692-e7d5-418d-8f03-364f4f40fce3","nodeName":"hermes","initialPropertyValues":{"uriPathSegment":{"value":"home","type":"string"},"title":{"value":"HERMES VBS","type":"string"}},"nodeAggregateClassification":"regular","nodeReferences":[]}
{"workspaceName":"live","contentStreamId":"52f2294d-3e87-4ab7-95f3-c3ebb81fb5d2","nodeAggregateId":"11fac35c-7811-4462-a8b4-48aff0982985","newNodeName":"hermes"}

events-metadata:

{"commandClass":"Neos\\ContentRepository\\Core\\Feature\\NodeCreation\\Command\\CreateNodeAggregateWithNodeAndSerializedProperties","commandPayload":{"workspaceName":"live","nodeAggregateId":"11fac35c-7811-4462-a8b4-48aff0982985","nodeTypeName":"ICTpark.Hermes:Document.Homepage","originDimensionSpacePoint":{"language":"de"},"parentNodeAggregateId":"97887692-e7d5-418d-8f03-364f4f40fce3","initialPropertyValues":{"title":{"value":"HERMES VBS","type":"string"}},"succeedingSiblingNodeAggregateId":null,"nodeName":"hermes","tetheredDescendantNodeAggregateIds":{"teaser":"90604f85-2806-4472-9534-d0eef0143aec","main":"59f739c0-fe49-499c-9bc4-c70cdd3d3283","notfound":"e2093c20-7ecb-455b-898d-a0788e4a0c22","notfound\/main":"0b6c6cbd-485e-4469-8303-ef452c56b3c0","footer":"37361c15-d1b7-4397-84e2-7f398969167c"},"references":[]},"initiatingUserId":"system","initiatingTimestamp":"2024-12-02T15:23:45+01:00"}`
"commandClass":"Neos\\ContentRepository\\Core\\Feature\\NodeRenaming\\Command\\ChangeNodeAggregateName","commandPayload":{"workspaceName":"live","nodeAggregateId":"11fac35c-7811-4462-a8b4-48aff0982985","newNodeName":"hermes"},"initiatingUserId":"77e72f4b-5fbe-42bc-8b20-23d4a2838ba2","initiatingTimestamp":"2024-12-03T08:34:10+01:00"}

Maybe that was not the best idea :wink: But I don’t understand why it’s running in the backend, but not in the frontend :frowning:

PS: references are working, but no backreferences

okay thanks for your information so far.

it seems you used actually the ContentRepository API way to rename the node via ChangeNodeAggregateName which is perfect. There is just no CLI command to do that, but this CR command in combination with $site->setNodeName() should be fine. You did a replace on the database additionally and a replay id say that was unnecessary but should work as well especially as the site entities row in neos_neos_domain_model_site probably also got replaced then.

It seem the problem of that in the frontend the back references are not working and also the main content collection of the site node is not rendering correctly is then not caused by the renaming, and i bet it was there before the name adjustment?

Assuming the correct queries are run there is one more difference between backend and frontend: In frontend the user workspace is “live” and in backend it’s a nested workspace. So possibly your user workspace contains changes that are not visible via the publish button?
That can be seen in cr_default_p_graph_contentstream in the hasChanges flag.
If the user workspace contains somehow more changes, a creation of a new test user should then show the same “missing” data than in live. If that is the case we have to dig into that further.

Thanks for your response. To be honest: I’m not sure if the problem existed before changing the nodes. I just realized it at some time.

This is how my table looks like:

It’s a live workspace and two user workspaces.

I now created a new test user that did not exist before.

The backend looks like the backend of the other two users. Everything works there. Now the table got (of course) one more row:

Jan

1 Like

okay thanks, in that case it might be rather a rendering problem or something but not that the content repository is “wrong” :smiley:

Before i look into this fully myself … if i can?.. one more thing

what happens if you render the “live” workspace directly in the backend?
by using neos-ui/Classes/Controller/BackendController.php at f8c9527320cf133705920c54496bbb22400868b8 · neos/neos-ui · GitHub

$workspace = $contentRepository->findWorkspaceByName(WorkspaceName::forLive());

or even better rendering the live uris via backend like edit (inPlace) mode in neos-development-collection/Neos.Neos/Classes/Controller/Frontend/NodeController.php at 466c89e583dbbc9bfdf356e256f7f5cea69ec28f · neos/neos-development-collection · GitHub

$this->view->setOption('renderingModeName', 'inPlace');

Maybe that gives us a hint what is so different about backend vs frontend.

1 Like

I’ll be in the office this afternoon and will test it…

No change at all.

image

And no change, too.

I deleted Data/Temporary before each try - just to be sure…

1 Like

Thanks for running these experiments though i cannot really find out the reason for this now remote. Maybe it would be possible to get ahold of your event stream so we can test this ourselves? Im MarcHenrySchultz on slack