Default value of drop down list property on document type
Hi all,
Experiencing some strange behavior here on 7.2.0.
I have a drop down list property attached to a document type. This property is not mandatory.
However, if I don't select a prevalue from the drop down list when creating content (leaving the drop down list blank), then the property value is set to "23". Is this normal behavior? I was expecting either a blank string, or a null value!
I have discovered that the drop down property was actually mandatory - changing the property to non-mandatory returns an empty string as I expected.
However, when creating the content with the property set to mandatory, I was able to successfully create without setting a value. This is no longer the case - when I change to property back to mandatory, I cannot create content without selecting from the drop down (as expected!)
Very unusual, but seems to have resolved itself! :)
As a somewhat related problem, I am attempting to get all nodes where the value of the drop down list property is equal to a certain string, or has not been specified:
Default value of drop down list property on document type
Hi all,
Experiencing some strange behavior here on 7.2.0.
I have a drop down list property attached to a document type. This property is not mandatory.
However, if I don't select a prevalue from the drop down list when creating content (leaving the drop down list blank), then the property value is set to
"23"
. Is this normal behavior? I was expecting either a blank string, or a null value!Many thanks.
Hi Phil
Could you show a screendump of what it looks like in your backoffice? It should just return a falsy value like empty, 0, null for instance I think.
/Jan
Jan,
I have discovered that the drop down property was actually mandatory - changing the property to non-mandatory returns an empty
string
as I expected.However, when creating the content with the property set to mandatory, I was able to successfully create without setting a value. This is no longer the case - when I change to property back to mandatory, I cannot create content without selecting from the drop down (as expected!)
Very unusual, but seems to have resolved itself! :)
Jan,
As a somewhat related problem, I am attempting to get all nodes where the value of the drop down list property is equal to a certain string, or has not been specified:
However, this always returns nothing. What is the best way to go about this?
Hi Phil
Well that's probably because you're asking for those "myDocumentType" aliases where the value is either "value" or empty.
I think that you should instead be able to do this
Does this work?
/Jan
Jan,
I don't think that that will achieve what I am after - let's say that I have a document type called
Blog
, which has three properties:I am attempting to create a paged list of blogs, so I need to extract all blogs into a variable before displaying so that I can evaluate the count.
However, in the list of blogs, I would like to show blogs where the category is equal to
"Tutorial"
or the category has not been selected.How would I be able to select a list of blogs that have a category of
"Tutorial"
or a category of""
?is working on a reply...