Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Property with AutoSuggestSelection attribute always looks empty despite having a value

Ted
Ted
Vote:
 

I've implemented an ISelectionQuery that I'm using with an AutoSuggestSelection attribute as described here: https://docs.developers.optimizely.com/content-management-system/docs/built-in-auto-suggestion-editor

It works fine (searching/selecting/saving values), except the GetItemByValue() method is never invoked, meaning the property ends up looking empty when editing, even though the property value is set.

The value is there, so it renders as expected - but there's no way for an editor to see what the actual property value is.

This is obviously quite confusing for web editors. :)

Can anyone confirm whether this is a bug?

Edit #1:

This pointed me in the right direction: https://world.optimizely.com/forum/developer-forum/CMS/Thread-Container/2019/6/possible-iselectionquery-bug-for-getitembyvalue

The actual property value was a URL, which caused the request for the selectionquery REST store to fail.

Edit #2:
This seems related: https://world.optimizely.com/forum/developer-forum/cms-12/thread-container/2023/1/iselectionquery-values-url-encoded

#303754
Edited, Jun 19, 2023 15:00
Vote:
 

Im curious to the issue you are having Ted. Using a few AutoSuggestSelection in my latest work but i've not come across this issue.

Am I understanding correctly that you have an ISelectionQuery containing URLs? Do you have a screenshot of the issue? I assume its when the editor is attempting to what's already saved against the property but it's not visible?

#303896
Jun 21, 2023 21:31
Ted - Jun 22, 2023 15:04
You should be able to reproduce the issue if you add ISelectItem instances where the Value property is a URL like: https://temp.uri/
The UI makes a REST store request where the value is appended to the URL without encoding, which leads to a failed request.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.