decaporg / decaporg/decap-cms

Cannot use template string with wildcard as value_field for relation widget

Open
#5,487 1 comment 0 reactions 0 assignees View on GitHub
area: extensions/widgets/relation area: slugs exp: intermediate type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**
When using a template string that contains a `*` wildcard (to access every item of a list) as `value_field` of a relation widget, the widget says "No options".

**To Reproduce**
1. Create a list widget, with fields `a` and `b`, and populate it
2. Create a relation widget that points to the previous list
3. Set `value_field` to `'mylist.*.a'`
4. It works
5. Set `value_field` to `'a is {{mylist.*.a}} - and b {{mylist.*.b}}'`
6. It says "No options"

**Expected behavior**
Template string should work even with wildcard.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the relation widget with a template string containing wildcard values such as `mylist.*.a` and inspect the value_field handling and template parsing. Done means the relation widget presents options instead of "No options" when the template includes wildcard fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.