displayName gets removed in a Content Studio

Enonic version: 6.9.0
OS: Elementary Os Loki(Ubuntu 16/04)

Hello,
displayName gets removed sometimes in a Content Studio. I presume, that happens when validation is failed. Is this the way it should work? Or is this a bug?

Thanks
Max

Hi Max,

That is not intended. Does the content type you are using have any display-name-script defined?

Hi Bobby

This happens on all(or almost all) content types, that we are using. Also, we don’t use any scripts for it.

Thanks

We had issues with display-name-scripts but fixed them in 6.9. I thought it could be related.

Can you try and give me instructions on how to repeat this issue? Only gets removed when validation fails? Which browser? Tried any other 6.9-version than “0”?

So I’ve made some deeper investigations on this. Steps to reproduce:
displayName should be like this in a content type:

<content-display-name-script>$('name')</content-display-name-script>

  1. Fill in all the required inputs in a content type
  2. Save and publish it
  3. Edit it again and make any of the required inputs blank
  4. displayName should disappear.

Thanks

For a start, you should remove your content-display-name-script, and if you have a “name” input, remove this as well. Your approach simply replicates a single property into the display name field, and in this case you are better off writing that value into the display name directly imho.

Otherwise the script looks ok, so we’ll try to replicate it!

Hello, Thomas

I feel like I’ve understood everything after your reply and I feel myself silly now.
There is no “name” input in our code, so that’s why this happens and it seems like this is totally our mistake.
Sorry for wasting your time.

Thanks

1 Like

Hehe, always nice for us when that happens =)

Just keep your eyes open, as mentioned, we fixed issues with this display-name-script in 6.9 and it might be something we missed. But if you don’t have that field, then that would explain the error. And as Thomas said, remove the display-name-script if only one field is used in there, because then you could just as easily use the built-in displayName field instead =)