You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If config.yml defines a file collection containing a file with a field with name: data, trying to publish changes to that file through the CMS causes an error toast with "Error: No file found for undefined in {collection name}" and the update fails.
To Reproduce
For me, this problem happens when I have the following in my config.yml (besides backend and some url and path configuration like media_folder etc). The important part is the name: data field in File.
If I then open the CMS and open up the editor for File, any existing value for the 'data' field is shown as expected. However, if I edit that value and then press the button to publish, the error is shown ("Error: No file found for undefined in collection") and the update fails.
Expected behavior
Don't show an error and update the file.
Additional context
Some things that I found while investigating this problem:
To produce the error, the filename does not matter (eg file.json) and neither does the extension (tested with json and yml). Also the name values of the File and the Collection don't matter.
The error does not occur when name: data is used somewhere else in the config, ie for the file or the collection. The error only occurs when name: data is used for the field.
The error does not occur when name: data is changed to something else, like datax or field1.
A little background on why I want a field with name: data: I want to be able to edit (part of) the config file of JSSSG through Decap CMS, specifically the data field that defines global site data. I can think of workarounds to this error (like having the CMS edit a field called datax and then changing it to data in my build process, or something), but I'd rather not have to resort to that.
Is this indeed a bug, or am I doing something wrong here? I'd be very grateful for any insights! Thanks in advance.
The text was updated successfully, but these errors were encountered:
werenike
changed the title
"Error: No file found for undefined" when field has 'data' as name
"Error: No file found for undefined" when field has 'name: data'
Feb 15, 2025
Describe the bug
If
config.yml
defines a file collection containing a file with a field withname: data
, trying to publish changes to that file through the CMS causes an error toast with "Error: No file found for undefined in {collection name}" and the update fails.To Reproduce
For me, this problem happens when I have the following in my
config.yml
(besidesbackend
and some url and path configuration likemedia_folder
etc). The important part is thename: data
field in File.If I then open the CMS and open up the editor for File, any existing value for the 'data' field is shown as expected. However, if I edit that value and then press the button to publish, the error is shown ("Error: No file found for undefined in collection") and the update fails.
Expected behavior
Don't show an error and update the file.
Applicable Versions:
Additional context
Some things that I found while investigating this problem:
file.json
) and neither does the extension (tested withjson
andyml
). Also thename
values of the File and the Collection don't matter.name: data
is used somewhere else in the config, ie for the file or the collection. The error only occurs whenname: data
is used for the field.name: data
is changed to something else, likedatax
orfield1
.A little background on why I want a field with
name: data
: I want to be able to edit (part of) the config file of JSSSG through Decap CMS, specifically thedata
field that defines global site data. I can think of workarounds to this error (like having the CMS edit a field calleddatax
and then changing it todata
in my build process, or something), but I'd rather not have to resort to that.Is this indeed a bug, or am I doing something wrong here? I'd be very grateful for any insights! Thanks in advance.
The text was updated successfully, but these errors were encountered: