Enhance translation handling in EditPage and TranslationTabs: Implemented eager loading for translations to optimize performance and avoid N+1 query issues. Updated the EditPage mount method to load translations, and modified the fillFromRecord method in TranslationTabs to utilize eager-loaded translations. Disabled old format conversion in mutateFormDataBeforeFill to prevent memory exhaustion with nested arrays, ensuring data integrity while maintaining original format.

This commit is contained in:
Ümit Tunç
2025-11-01 16:40:20 -03:00
parent 5fb74384ce
commit af0d7964ca
3 changed files with 27 additions and 57 deletions
@@ -526,12 +526,13 @@ class PageForm
->addActionLabel(__('pages.section_add'))
->reorderable()
->collapsible()
->collapsed()
->itemLabel(fn (array $state): ?string => isset($state['type']) ? __('pages.section_type_' . $state['type']) : 'Bölüm')
->columnSpanFull(),
])
->columnSpanFull()
->collapsible(true)
->collapsed(false),
->collapsed(true),
// Dynamic Template System
Section::make(__('pages.form_section_header_template'))
@@ -746,9 +747,8 @@ class PageForm
->addActionLabel(__('pages.add_template_section'))
->reorderable()
->collapsible()
->itemLabel(fn (array $state): ?string =>
SectionTemplate::find($state['section_template_id'] ?? null)?->title ?? __('pages.template_section')
)
->collapsed()
->itemLabel(__('pages.template_section'))
->columnSpanFull(),
])
->columnSpanFull()