Overview
Working on creating a content template, I ran into a 500 error when trying to publish it:
assert($field_item_list instanceof FieldItemListInterface)
The field in the content type List (text) field and the filed in the component is a type: string . Is this a known bug, or anyone have any thoughts on this? on Canvas 1.3.3
It fails kind of silently. In the UI will act like it published the page, but it doesn't (the page remains in the queue of changes). The error only shows up in the console, not in the UI.
Proposed resolution
The value of a List (text) field in a content type should be a valid match for a type: string field in an SDC
User interface changes
If this is not meant to be a valid field link, either don't allow the user to link it at all, or display a better error in the UI.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2026-05-05 at 1.06.38 PM.png | 108.19 KB | kmwarboy |
Issue fork canvas-3588520
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
shubham.prakash commentedComment #5
wim leersThe functionality described in this issue was introduced in #3548749: Allow mapping "List (string)" field type to `type: string`, with a twist: don't map the stored value, but its key/name/label.
Reproduced.
Comment #6
wim leersInteresting analysis, @shubham.prakash, on the MR:
What was the missing piece for me, was the backtrace: https://git.drupalcode.org/project/canvas/-/merge_requests/1058#note_823232
That allowed me to add a test that proves @shubham.prakash's fixed the original reported bug … but didn't actually fix the root cause 😅 The root cause allowed me to actually just delete some code 🎉
Details: https://git.drupalcode.org/project/canvas/-/merge_requests/1058#note_823269.
Comment #7
wim leersAligning with the issue queue component that the MR that introduced this bug.
Comment #8
wim leersThis prevents you from exposing certain information from Canvas!
Critical bug because if you need to use such a field, there is no work-around.
Thanks for the bug report, @kmwarboy, and the initial fix, @shubham.prakash! 🙇🏻♂️
Comment #9
wim leersComment #10
wim leersComment #12
wim leers