Repository navigation
fix(ui): resolve globals correctly in copyDataFromLocale - #16334
Open
robinvandenb wants to merge 1 commit into
Open
robinvandenb wants to merge 1 commit into
robinvandenb wants to merge 1 commit into
Conversation
robinvandenb
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
April 21, 2026 09:40
Filip-Ermenkov
added a commit
to Filip-Ermenkov/Service-Calculator
that referenced
this pull request
Oct 23, 2026
… bug (#115) * docs: record the live AWS checks and the upstream Payload copy-locale bug Everything here was read from the live account or reproduced on 2026-10-23. Payload's "Copy to locale" crashes on every global. The client hit it four times on 2026-10-17 (French to English, on Company Info or Legal Info), and the CloudFront 5xx alarm was the only thing that noticed. The bug is upstream: @payloadcms/ui's copyDataFromLocale reads payload.globals[slug].config, but payload.globals is { config: [...] } with no per-slug keys. It reproduces against the local database with the identical log line, it is still present in Payload 3.92.0, and two fixes are open upstream (payloadcms/payload#16334, #17072). It is deliberately not patched here; PROGRESS records it with the check that says when to delete the entry, and FUNCTIONALITY §6 tells the client the workaround, which is the intended workflow anyway: write in English and let French and German be generated. Corrections from the live account: - Lambda's account limit is already 400, not the default 10 that PROGRESS and an sst.config.ts comment claimed. AWS raises it on its own. A request for 1000 is open. - SES production access was requested. AWS's first response can take up to 96 hours (PROGRESS said ~24h), and the review reads DENIED until the requested details are sent. Testing after approval needs an address that is not a verified identity, or it proves nothing. - Monitoring is proven: all twelve alarms OK, both SNS subscriptions confirmed, and a forced ALARM in each region was delivered with no failures. - Visitors make no request to Google for fonts. They are served from the build. The build-time dependency on Google's font CDN is still real. - New housekeeping item: pg v9 will give sslmode=require libpq semantics, which skip certificate verification. Move the Neon URLs to sslmode=verify-full first. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: the SES reputation alarms are applied Applied from main on 2026-10-23. The plan was exactly 2 to add, 0 to change, 0 to destroy with no drift, and a follow-up plan shows no changes. Both alarms sit in INSUFFICIENT_DATA because the account has sent no mail in weeks. That is the designed "watching nothing" state, not a fault. What remains is reading the metric's publishing cadence once mail flows after SES production access. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: track the DPA check, Search Console and the deploy-role tightening Three pre-launch and post-launch items that existed only elsewhere, or nowhere: - Data processing agreements (new step 6). The published Privacy Policy says every processor acts under a DPA, and TECHSPEC §7A says that has to be confirmed, not assumed. PROGRESS never listed it. - Google Search Console in the launch flip, with the trap spelled out: workspace-mail.tf owns the whole root TXT set, so a verification value added by hand in Route 53 is replaced by the next terraform apply. - IAM Access Analyzer for the deploy role. infra/aws/README.md has said it was "tracked in PROGRESS → What is left" while it wasn't. The launch flip and housekeeping steps move from 6/7 to 7/8. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Calling the server function
copyDataFromLocaleHandlerwith aglobalSlug(triggered by the admin UI's "Copy to locale" button on any Global) crashes with:The same button works fine for Collections. For Globals it is 100% broken. Reproducible on current
mainand released versions up to at leastv3.83.0.Repro steps
localizationenabled and ≥ 2 locales, define a Global (e.g.{ slug: 'homescreen-layout', fields: [...] }).Root cause
copyDataFromLocaledestructuredglobalsoffreq.payloadand then looked upglobals[globalSlug].config.fields, assumingpayload.globalsis a slug-keyed map the waypayload.collectionsis. It isn't. Perpackages/payload/src/index.ts,payload.globalsalways has shape{ config: SanitizedGlobalConfig[] }. Every other place in the codebase (e.g.packages/payload/src/globals/operations/local/findOne.ts,update.ts,restoreVersion.ts,findVersions.ts,findVersionByID.ts,countVersions.ts,utilities/handleEndpoints.ts,utilities/getRequestEntity.ts) resolves a global viapayload.globals.config.find((c) => c.slug === globalSlug).copyDataFromLocalewas the only offender, soglobals[globalSlug]was alwaysundefinedfor a real slug and.configthrew.The fix
payload.globals.config.find((c) => c.slug === globalSlug), matching the rest of Payload.APIError("The global with slug X can't be found.", 404)if the slug is missing (mirrored the same guard on the collection branch so a badcollectionSlugno longer crashes onundefined.config.fieldseither).globalsdestructure.Public signatures of
copyDataFromLocale/copyDataFromLocaleHandlerare unchanged.Tests
Added under
test/localization/int.spec.ts, inside the existingCopying To Localeblock:copies undefined fields from a source locale to a target locale on a global— seedsen, clearses, callscopyDataFromLocaleHandlerwithglobalSlug, assertstitleandgroup.subtitleare copied on theesdraft. This would have failed onmainwith the originalTypeError.throws a clear error when the global slug does not exist— asserts the newAPIErrorpath.Introduced a minimal
localized-global-for-copyglobal intest/localization/config.tsfor the round-trip.Run locally with: