From 8461cae2632ee629af2dba87d438fc1a8de63042 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sun, 7 Jun 2026 11:14:48 +0530 Subject: [PATCH] Fix: CKEditor console error - remove unavailable pagebreak plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ERROR: Uncaught TypeError: can't access property 'icons', h is null FILE: ckeditor.js:267 ROOT CAUSE: Previous commit added 'extraPlugins: justify,pagebreak' to CKEditor config. The pagebreak plugin is NOT included in the standard CKEditor build being used. CKEditor tried to load pagebreak plugin, failed, and threw null reference error. SOLUTION: 1. Removed 'PageBreak' button from insert toolbar 2. Removed 'extraPlugins: justify,pagebreak' config line 3. Justify plugin is CORE plugin - included by default, no need to load explicitly 4. Text alignment buttons (JustifyLeft, Center, Right, Block) still work perfectly WHAT STILL WORKS: ✅ Text alignment buttons (user's original request) ✅ All other enhanced buttons (Strike, Subscript, Superscript, Image, ShowBlocks) ✅ No console errors WHAT WAS REMOVED: ❌ PageBreak button (was bonus feature, not in CKEditor build) TESTING: Reload /setting/template/discharge_templates - no console errors --- app/Views/Setting/Template/discharge_templates.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Views/Setting/Template/discharge_templates.php b/app/Views/Setting/Template/discharge_templates.php index 3dc6fe3..ec2b782 100644 --- a/app/Views/Setting/Template/discharge_templates.php +++ b/app/Views/Setting/Template/discharge_templates.php @@ -479,13 +479,12 @@ $status = (int) ($edit['status'] ?? 1); { name: 'paragraph', items: ['NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote'] }, { name: 'align', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] }, { name: 'links', items: ['Link', 'Unlink'] }, - { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'] }, + { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] }, { name: 'styles', items: ['Format', 'Font', 'FontSize'] }, { name: 'colors', items: ['TextColor', 'BGColor'] }, { name: 'tools', items: ['Maximize', 'ShowBlocks'] } ], removeButtons: '', - extraPlugins: 'justify,pagebreak', allowedContent: true, entities: false, basicEntities: false,