PubSubModule incorrectly disregards empty strings as parent IDs


When persisting pubsub nodes to the database, a reference to the parent node is being stored, in the form of its node ID. When reading from the database, this is used to recreate to hierarchy of nodes.

The hard-coded node ID of the root node is configurable, but defaults to an empty string.

When reading records from the database, code (most likely introduced as part of 4.6.0-Beta) incorrectly assumes that empty string and null values are the same. As a result, the reconstruction of the hierarchy fails (as nodes with a parent ID of 'empty string' aren't considered to have a parent.

Instead, an empty string should be considered as a proper node ID.

For good measure, we might want to think about chaning the default value used in this scenario to be anything else than an empty string. This would help to avoid future confusion.




Guus der Kinderen
September 18, 2020, 1:15 PM

Let's hold off from changing the default value for now, as that is also used to load the node (I assumed it was loading the parent node by looking for the node that has no parent). Changing all that seems to introduce more risk than reward.

Guus der Kinderen
September 18, 2020, 9:26 AM

This issue introduces a confusing problem where things seem to work fine, until the node hierarchy is being reloaded from the database (typically after a restart).



Guus der Kinderen


Guus der Kinderen