As it is.
Our last breaking change was in 1.6.1
, if you are using version 1.6.0
or older, here are the details of changes and how to migrate.
While 1.7.0
is not considered a breaking change, it is worth noting that we added additional validation to the following queries:
Either scenario will now result in an error being thrown, you can read more about the why we made this change here.
Hello @JessChowdhury!
I previously used "payload": "1.6.32"
and attempted to replace it with the next "payload": "1.7.0"
. However, I encountered an issue with access control in one of my collections.
This collections contains upload field asset
.
We only return files with permitted extensions for one of the user roles.
I use something like access: accessFunction,
in collection
Where accessFunction has this part of code ('en' is default locale,${locale}
is current locale from the query)
..
const suitableFileExtensions = {
or: [
{ 'asset.filename': { contains: '.ext1' } },
{ 'asset.filename': { contains: '.ext1' } },
],
}
const suitableFileExtensionsInEnLocale = {
and: [
{
or: [
{ [`asset.en.filename`]: { contains: '.ext1' } },
{ [`asset.en.filename`]: { contains: '.ext2' } },
],
},
{ [`asset.${locale}`]: { exists: false } },
],
}
...
return {
or: [suitableFileExtensions, suitableFileExtensionsInEnLocale],
}
Do you have any idea which part of this release could potentially affect it?
UPD: another strange thing that when I replace extension with filename without extension - it works, for example:
I have asset with full name myasset.ext1
If I use condition {['asset.en.url']: { contains: '.ext1' }}
it returns nothing
But if I write {['asset.en.url']: { contains: 'myasset' }}
it returns the correct result
Star
Discord
online
Get dedicated engineering support directly from the Payload team..