Skip to content

Commit 2248be4

Browse files
fix: utilizes override access false (#9550)
### What? overrideAccess was missing on local operations inside the server function for copy locale. ### How? Adds overrideAccess: false
1 parent 21db058 commit 2248be4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/ui/src/utilities/copyDataFromLocale.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,31 @@ export const copyDataFromLocale = async (args: CopyDataFromLocaleArgs) => {
190190
? payload.findGlobal({
191191
slug: globalSlug,
192192
locale: fromLocale,
193+
overrideAccess: false,
193194
user,
194195
// `select` would allow us to select only the fields we need in the future
195196
})
196197
: payload.findByID({
197198
id: docID,
198199
collection: collectionSlug,
199200
locale: fromLocale,
201+
overrideAccess: false,
200202
user,
201203
// `select` would allow us to select only the fields we need in the future
202204
}),
203205
globalSlug
204206
? payload.findGlobal({
205207
slug: globalSlug,
206208
locale: toLocale,
209+
overrideAccess: false,
207210
user,
208211
// `select` would allow us to select only the fields we need in the future
209212
})
210213
: payload.findByID({
211214
id: docID,
212215
collection: collectionSlug,
213216
locale: toLocale,
217+
overrideAccess: false,
214218
user,
215219
// `select` would allow us to select only the fields we need in the future
216220
}),
@@ -231,6 +235,7 @@ export const copyDataFromLocale = async (args: CopyDataFromLocaleArgs) => {
231235
? fromLocaleData.value
232236
: mergeData(fromLocaleData.value, toLocaleData.value, globals[globalSlug].config.fields),
233237
locale: toLocale,
238+
overrideAccess: false,
234239
user,
235240
})
236241
: await payload.update({
@@ -244,6 +249,7 @@ export const copyDataFromLocale = async (args: CopyDataFromLocaleArgs) => {
244249
collections[collectionSlug].config.fields,
245250
),
246251
locale: toLocale,
252+
overrideAccess: false,
247253
user,
248254
})
249255

test/localization/e2e.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ describe('Localization', () => {
261261
await createAndSaveDoc(page, url, { description, title })
262262
await openCopyToLocaleDrawer(page)
263263
await expect(page.locator('.copy-locale-data__content')).toBeVisible()
264+
await page.locator('.drawer-close-button').click()
264265
})
265266

266267
test('should copy data to correct locale', async () => {

0 commit comments

Comments
 (0)