neos-ui
neos-ui copied to clipboard
Nodes can be hidden, even though they should not be hideable
Description
Having a node with an auto-created childNode of a custom type here.
When selecting that childNode in the structure tree, it cannot be hidden using the icons in the tree or the content area.
But the inspector has a checkbox, and that is still active, so the node can be hidden.
Expected behavior
The node cannot be hidden at all.
Actual behavior
The node can be hidden using the inspector.
Affected Versions
Neos: 4.0.9
UI: reproduced with 1.3.4 & 1.4.1
To cross-check, I added the HidableMixin to Neos.Neos:ContentCollection and the behaviour is the same: not hideable via the icons, but using the inspector. So the logic to disallow hiding seems to be inconsistent.
technically you shouldn't be able to hide a childnode because the parent relies on it being there. if it's optional you might as well let the user create it on demand, so the checkbox in the inspector should be disabled
I agree. The problem here is exactly that - it can be hidden, even though parts of the system already think it should not be possible…
Ooh, this change broke many pages for us. In our scenario we want to let Neos create pre-defined child nodes hidden by default in order to allow the editors to activate those nodes at some point in the future (for example to announce the winner of a competition etc).
We don't want to allow the editor to add or delete the child nodes so using auto-created child nodes seemed like the right tool for us..
technically you shouldn't be able to hide a childnode because the parent relies on it being there.
I beg to differ. It allows me to specify child nodes with a predefined node name, but it is not said that the parent has to rely on those child nodes not to be hidden (unless I manually disable/hide the _hidden property from the inspector)
Hi @bwaidelich,
I'm sorry this is causing trouble for you :(
Unfortunately, I don't see a proper way out of here other than to revert this change. And actually, if hidden auto-created child nodes are a scenario that should be supported, the StructureTree behavior should be changed as well.
I guess, we'll need a discussion for the latter. (I also could imagine something like adding an optional or required flag to the childNodes configuration of the NodeType schema)
As for reverting this change: Are you aware of any projects that would face serious problems by the ability to hide auto-created child nodes, @kdambekalns & @kitsunet? If not, I'd say we should just revert.
Do we need to anticipate anything here regarding the new CR, @bwaidelich?
@grebaldi There is absolutely no reason to be sorry!
actually, if hidden auto-created child nodes are a scenario that should be supported, the StructureTree behavior should be changed as well
I don't know why it was an issue with the StructureTree but I will look into this.
I also could imagine something like adding an optional or required flag to the childNodes configuration
IMO we don't need a new option for that since we can already control the editors via Node Type schema.
I do think that we should promote a more "conservative" use of the _hidden* properties in general: I made good experiences with hiding them by default and creating a mixin that has to be implemented in order for editors to be able to hide nodes.
Maybe that could be the default behavior at some point (also avoiding broken sites because someone accidentally disabled the homepage).
Do we need to anticipate anything here regarding the new CR
Not really AFAIK, tethered nodes (as they are called there) are handled slightly differently, but we'll face the same logical questions.
As for _hiddenBeforeDateTime and _hiddenAfterDateTime – those won't be supported (at least not in v1) because they are very hard to implement in a ES world (some kind of cronjob-mechanism for those would make it easier and more explicit).
btw: I think with your change it's still possible to disable nodes with those timed properties
I just found out, that Neos.Demo creates it NotFound-Page with defaultValue = true for _hidden, and a comment says "Has to be enabled manually" - the only way to do that is to change it directly in the databse.
Which by the way leads to an extremely doubtfull behavior of the page tree: It shows the autocreated node as hidden until you select it, than it switches to visible. ("x" vanishes)
Not constructive, but obviously @bwaidelich is not the only person who relied on having defaults changeable ;)