The uid field seems to auto fill based on the most recently updated text field

When creating a new document that has a uid field that uid field auto-updates with the content from the most recently updated text field until the uid field is manually edited. Is there anyway to set the source field the uid uses to generate its content?

e.g. There are 3 fields on a document, a heading field named title, a uid field and a key text field named author. When you type in the title field the uid will update with the content from that field converted to be url safe. However when you then start typing in the author field the uid will then update its content from this new field. This behavior seems to extend to other field types as well.

This is not expected behavior and makes it very easy to use the wrong slug/uid for the document

You might be able to change this by editing the default document title:

I’m not entirely sure if this will work though.

Yeah I’ve already tried that, doesn’t seem to affect the uid field logic.

Before you initially save the document the UID field will update with the last Title or Rich Text field that you add text to. Unfortunately at the moment there is no way to control which field is used for the UID autofill.

I discussed this with the UX team and they agree that this should be improved at some point in the future.

@features-team

I just tested out overriding the default document name mentioned by @marcellothearcane. The UID field now always references the field that I set as the default title

"title" : {
  "type" : "Text",
  "config" : {
    "label" : "Document Title",
    "useAsTitle" : true
  }
}
1 Like

I have come across an issue in one of the Document Types where every text field (Title or single Paragraph) that I’m using on that Doc Type is updating the Unique ID field. Originally, and on all other Doc Types, only the Title field updates the Unique ID field and I can’t see why it has started to happen to just the single Doc Type.
Has anyone got any suggestions?

Hi Diz,

I just saw your message as it was in one of the category descriptions.

We’ve discussed what you’re experiencing here. It sounds like the single Doc Type is UID is not updating from the title field as the title field in that custom type is not configured like @jmathew1991 has described.

Let me know if this helps or if you have any other questions.

Thanks.

Hi Phil,

I have set the “useAsTitle” value to true in the JSON and the issue is still happening. All of the other Doc Types I have created work fine without the “useAsTitle” value being set. It’s just this one Doc Type that I’m finding the issue.

The title is definitely getting updated from the title field but the other text fields within the Doc Type is updating the UID value. I have even set the “useAsTitle” value false on all of the other text fields and the issue is still happening.

OK, that strange. Are you adding content in the other fields first, like a rich text? because the UID will fill from any text field where content is added first?

No, I’m adding the Title (which updates the UID), then every time I enter anything in the other text fields it will update the UID as well.

Can you send me your repo id in a private message so I can look in to this further?

Hey Diz,

I made a clone of your repo to test this and it seems to work as expected for me. You can see my test here.

Hi Phil,

Sorry, I’ve just seen this. Looking at the video above, you aren’t entering the “Short Summary” field. If I enter in the title the UID gets updated (correctly). But, if you enter a short summary the UID gets updated, which isn’t want we want to happen.

Hey,

I’m still not seeing the behaviour you’re describing.

Can you send me a screen recording of what you’re describing?

Thanks.

Hi Phil,

Please can you do the following steps on your cloned repo?

  1. Enter a Title .
  2. Enter a Short Summary.
  3. Check if the UID has updated with the short summary value.

I will send over a screen recording later on today, when I have shorted out a tool for it.

Thanks

Hey Diz,

I’ve done this is the previous video I just sent you, you’ll need to click play to see the full thing.

You can use gify capture or loom.

Okay I can see that now.

1 Like

Thank you for sending this. OK, this is very clear now and not how it’s behaving in the clone which is strange.

Now I can see this I’m going to inform the dev team so they can investigate what’s going on here :slight_smile:

Ok thanks.

Is this likely to be looked at before Tuesday (15th September)? As the sit will be going live and this is something that we need to get fixed as all of the Article URL’s are currently wrong.

I really can’t say whether it will be fixed by then I’ll have to see what the dev team say, but I wouldn’t think so.

You can update the UID manually for the moment as a work around.