Node Dimension Behavior

This is not actually an RFC because the current behavior is already broken, so it’s more of a bugfix but it’s so big that I wanted to start a discussion about it.

The basic problem is this: dimensions are all fine but certain nodes do not have nor need dimensions. Simple examples that already exist are the root node “/” and the sites node “/sites”. Due to the way we fetch nodes when dimensions are configured those nodes that do not have dimensions basically do not exist in a Contxt with dimensions. This is already the first theoretical problem, because it technically results in nodes that have a broken breadcrumb.

It also has practical results seen for example here: Changing type of Homepage-node causes Footer to throw an exception

I am quite sure we also had the problem of “/sites” not being found before…
So all in all, the way it is, is broken.

The solution I have in mind is this:

If you have dimensions, any node without dimensions will still be found in ANY context (just talking about dimensions. Obviously not in different workspaces) but with the lowest priority. So any dimension fallback would take precedence but if then the node still was not found and there is one without any dimensions then that is used. That would automatically fix the breadcrumb problem from above and would also allow to specifically have nodes without dimensions if you don’t need them and still have those nodes accessible from all contexts.

This should not be too difficult to implement and mostly b/c. The edge case of someone having (content) nodes with dimensions and without might now show the nodes without dimensions that were previously unaccessible but technically you shouldn’t be able to create such a scenario anyway unless you created the nodes directly via PHP.

Any other ideas to that? Otherwise I would want to start an implementation of this ASAP…


Full support from my side. Remember to consider the problem of creating a context with no dimensions returns a context with default dimensions…

Sounds okay for me and I had the same issues for some projects. I remember there was a case why we wanted to differentiate between empty values for a dimension and the default dimension value. I can’t find a scenario right now in my head, but we have to check any bahavioral change thoroughly (new Behat scenarios etc.).

So the added behavior would be: if there’s empty dimension values for a dimension of a variant, it would match any given list of values of that dimension in the Context, but with the lowest (e.g. Max_int) priority to have the possibility of more specific variants.

In the end I’d say it’s semantically equivalent to always having a fallback value like “mul” in each preset and assigning that value by default to every dimension and variant, but removing it when having other values (speak translations). So we just implement that and what’s possible now) in an implicit way.

Hey everybody,

also +1 from my side for the proposed solution – definitely makes the system more predictable and reliable.

All the best,

See for tracking this issue.