Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Neos UI crashes after applying references with Neos.NodeTypes.ContentReferences:ContentReferences #3574

Closed
dlubitz opened this issue Jul 10, 2023 · 11 comments · Fixed by #3576
Assignees
Labels
7.3 Bug Label to mark the change as bugfix

Comments

@dlubitz
Copy link
Contributor

dlubitz commented Jul 10, 2023

Description

If I add references to the Neos.NodeTypes.ContentReferences:ContentReferences and apply them, some errors are thrown to the console. After that, I don't get any feedback on the UI to further action. E.g if I click the "publish" button afterward I don't get any feedback, but the publish is happen in the background.

I've this issue with Neos 7.3, but the "Key must be a string" errors are also shown in Neos UI 8.3, but not the last one at watchServerFeedback.

Steps to Reproduce

  1. Create node with type Neos.NodeTypes.ContentReferences:ContentReferences
  2. Select a random reference in ReferenceEditor
  3. Click apply

Actual behavior

image

Affected Versions

Neos: 7.3.13
UI: 7.3.17

@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 10, 2023

I'll add the server response as this might help to debug.

{
    "timestamp": "2023-07-10T14:49:54+0000",
    "feedbacks": [
        {
            "type": "Neos.Neos.Ui:UpdateWorkspaceInfo",
            "description": "New workspace info available.",
            "payload": {
                "name": "user-lubitz",
                "publishableNodes": [
                    {
                        "contextPath": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq@user-lubitz",
                        "documentContextPath": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4@user-lubitz"
                    }
                ],
                "baseWorkspace": "live",
                "readOnly": false
            }
        },
        {
            "type": "Neos.Neos.Ui:ReloadContentOutOfBand",
            "description": "Rendering of node \"\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq\" required.",
            "payload": {
                "contextPath": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq@user-lubitz",
                "nodeDomAddress": {
                    "contextPath": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq@user-lubitz",
                    "fusionPath": "..."
                },
                "renderedContent": "..."
            }
        },
        {
            "type": "Neos.Neos.Ui:UpdateNodeInfo",
            "description": "Updated info for node \"\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq@user-lubitz\" is available.",
            "payload": {
                "byContextPath": {
                    "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq@user-lubitz": {
                        "contextPath": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq@user-lubitz",
                        "name": "node-99wviknw8bfmq",
                        "identifier": "d523fc49-7909-4466-93f3-8541bc26e92f",
                        "nodeType": "Neos.NodeTypes.ContentReferences:ContentReferences",
                        "label": "Verweis auf Inhalt einf\u00fcgen",
                        "isAutoCreated": false,
                        "depth": 10,
                        "children": [],
                        "parent": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0@user-lubitz",
                        "matchesCurrentDimensions": true,
                        "properties": {
                            "_removed": false,
                            "_creationDateTime": "2023-07-10T14:44:03+00:00",
                            "_lastModificationDateTime": "2023-07-10T14:49:54+00:00",
                            "_lastPublicationDateTime": null,
                            "_path": "\/sites\/vendor\/node-55a7c2fd8b3d8\/node-5756db9b91547\/node-95am5850s6je3\/node-8f5uhbnmzv9b4\/main\/node-574ef2e2dd5f0\/column0\/node-99wviknw8bfmq",
                            "_name": "node-99wviknw8bfmq",
                            "_nodeType": "Neos.NodeTypes.ContentReferences:ContentReferences",
                            "neos_node_identifier": "",
                            "neos_workspace": "",
                            "neos_path": "",
                            "neos_parent_path": "",
                            "neos_sort_index": "",
                            "neos_type_and_supertypes": "",
                            "neos_last_modification_date_time": "",
                            "neos_last_publication_date_time": "",
                            "neos_creation_date_time": "",
                            "_hiddenBeforeDateTime": null,
                            "_hiddenAfterDateTime": null,
                            "_hidden": false,
                            "neos_hidden": "",
                            "neos_hidden_before_datetime": "",
                            "neos_hidden_after_datetime": "",
                            "references": [
                                "bdf5c7cb-6fcf-448b-9819-a43154b9c9b0",
                                "40d06fa8-c4ee-46d9-8fc7-5d4043686a39"
                            ]
                        },
                        "isFullyLoaded": true
                    }
                }
            }
        },
        {
            "type": "Neos.Neos.Ui:Info",
            "description": "Information available",
            "payload": {
                "message": "1 \u00c4nderung erfolgreich angewendet.",
                "severity": "INFO"
            }
        }
    ]
}

@dlubitz dlubitz added Bug Label to mark the change as bugfix 7.3 labels Jul 10, 2023
@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 10, 2023

Seems to be caused by this place:
https://github.com/neos/neos-ui/blob/7.3/packages/neos-ui-guest-frame/src/initializePropertyDomNode.js#L25

nodeTypeName and propertyName are null, so no editor can get determined.

In Neos 8.3 the editor is fixed to "ckeditor5", to the bootstrap get returned properly.
https://github.com/neos/neos-ui/blob/8.3/packages/neos-ui-guest-frame/src/initializePropertyDomNode.js#L25

@Sebobo
Copy link
Member

Sebobo commented Jul 10, 2023

Can reproduce, will take a look

@Sebobo Sebobo self-assigned this Jul 10, 2023
@Sebobo
Copy link
Member

Sebobo commented Jul 10, 2023

@dlubitz did you notice any "problems" for the editors besides the console errors?

@mhsdesign
Copy link
Member

Only a problem for 7.3 starting with 8.0 (as you noticed) we removed the plugin point #3045

@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 10, 2023

@Sebobo Yes, as I wrote. If you do further things like "publish", you don't get any feedback anymore. (Butten stays orange, no loading spinner, ...)

Sebobo added a commit that referenced this issue Jul 10, 2023
…re yet

This can happen when a node is added via content references, as the backend doesn’t have any nodedata yet for the nodes that are rendered in the guest frame.

Resolves: #3574
@Sebobo
Copy link
Member

Sebobo commented Jul 10, 2023

So the initialisation is a bit too quick, as the node it wants to initialise is not yet loaded fully into the context.
I think a simple fix to skip nodes that are not ready yet should be enough. At least with that it works fine for me.

@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 10, 2023

Tested locally! Works for me too! Thank you for the quick reply and fix!

@mhsdesign
Copy link
Member

Fyi this is introduced because the html rendered from the ContentReferences contains content element wrapping of foreign nodes.

When one turns off the content element wrapping (via hierarchical override)

  prototype(Neos.Neos:ContentElementWrapping) {
    @if.render = false
  }

  prototype(Neos.Neos:Editable) {
    renderer.editable.condition = false
  }

this problem also disappears.

Is it ever intended to edit referenced nodes?

@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 10, 2023

@mhsdesign This works also like charm. IMHO the references shouldn't be allowed to edit in the content reference list. Not sure what the most solid solution is.

@Sebobo
Copy link
Member

Sebobo commented Jul 10, 2023

There are plugins that allow that in various ways. Therefore we need to support it, but I think we could disable it for the default implementation and get rid of some overhead there.

Sebobo added a commit that referenced this issue Jul 11, 2023
…re yet

This can happen when a node is added via content references, as the backend doesn’t have any nodedata yet for the nodes that are rendered in the guest frame.

Resolves: #3574
@crydotsnake crydotsnake linked a pull request Jul 11, 2023 that will close this issue
@dlubitz dlubitz closed this as completed Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.3 Bug Label to mark the change as bugfix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants