medusa
medusa copied to clipboard
Requested fields [store] are not valid` when getting a store product
Bug report
Describe the bug
I had extended the allowed fields for store to include additional fields like
imports.allowedStoreProductsFields = [ ...imports.allowedStoreProductsFields, "store_id", "store.store_handle", "store.name", "store.store_logo", "store.store_cover", ];
This was working perfectly
I did an upgrade of medusa 3 days ago from v1.20.2
to v1.20.4
and that has not been working since then. I get error Requested fields [store] are not valid
when getting a product.
Downgrading medusa to v1.20.2
works perfectly.
Basically a push was made that broke existing functionality and it is not in the changelog.
System information
Medusa version (including plugins): 1.20.4 Node.js version: v20 Database: postgres Operating system: MacOS Browser (if relevant): Chrome
Steps to reproduce the behavior
- Upgrade to v1.20.4
- Extend allowed store products fields to have an additional field
- Get the product via
store/products
endpoint - You will get error
Requested fields [yourfield] are not valid
Expected behavior
A product is returned including the additional field
same thing happened for me, it happens only in the ..Store...fields not on ...Admin..fields, this also happened when adding the plugin medusa-custom-attributes
Can you try to include store
in the extended allowed fields?
@adrien2p, this might have to do with #6647
Ill have a look
Also @olivermrbl shouldn't we document the new way of overriding the allowed fields?
This pr will generate a snapshot version that you should be able to test 💪
Adding store
field entirely works, i.e no error. But we would not want to add it entirely, as a security precaution. We would like only certain fields e.g store_handle, logo
etc which are in the store
field
@kevinrobert3 it should be good
Will be live in the next version right? @adrien2p