From what I see, the content is flagged as “invalid” - this means you will not be able to publish it I guess? What happens if you try creating the content directly in master?
In fact, an empty text is different from a null value. Null means that it does not exists, while “” is a text without any character. This is reinforced on strongly typed languages, like C#. If you want to avoid creation of these objects, you should at least run a function before creating with contentLib to clean these properties. for (var i in test) { if (test[i] === null || test[i] === undefined || test[i] === "") { delete test[i]; } }
“you should at least run a function before creating with contentLib”. We are checking the inputs before creating the content. I was just surprise that it allowed me to crate a object even though we have set the attributes to be required (“occurrences minimum=“1” maximum=“1”/>”). We can clearly see that interrogation mark in first picture saying that the object wasn’t create properly.
“You should always create content in the draft branch…” yes, that’s right. We are creating in the draft branch. I only changed it to master for test purposes.