From 75873843385b047072bb76330c51384769cd1fa5 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sun, 7 Jun 2026 11:22:58 +0530 Subject: [PATCH] Simplify CKEditor config - keep only text alignment buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUE: User reported alignment tools not showing and delete not working ROOT CAUSE: Over-complicated toolbar config with too many additions - Added Strike, Subscript, Superscript (not in standard build) - Added Image (might not be in build) - Added ShowBlocks (might not be in build) - Added extra config options that might conflict SOLUTION: Return to ORIGINAL working toolbar + ONLY alignment buttons - Restored original toolbar config that was working - Kept ONLY the alignment row: JustifyLeft, Center, Right, Block - Removed Strike, Subscript, Superscript, Image, ShowBlocks - Removed extra config: allowedContent, entities, fillEmptyBlocks, etc. - Delete function unchanged (already fixed in commit d025111) TOOLBAR NOW: ✅ Original working buttons (Source, Undo, Redo, Bold, Italic, etc.) ✅ Text alignment buttons (JustifyLeft, Center, Right, Block) - USER'S REQUEST ❌ Removed bonus features that caused issues This is minimal change - only adds what user asked for. --- app/Views/Setting/Template/discharge_templates.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/Views/Setting/Template/discharge_templates.php b/app/Views/Setting/Template/discharge_templates.php index ec2b782..6f676dd 100644 --- a/app/Views/Setting/Template/discharge_templates.php +++ b/app/Views/Setting/Template/discharge_templates.php @@ -475,20 +475,15 @@ $status = (int) ($edit['status'] ?? 1); toolbar: [ { name: 'document', items: ['Source'] }, { name: 'clipboard', items: ['Undo', 'Redo'] }, - { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', 'RemoveFormat'] }, + { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'RemoveFormat'] }, { 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'] }, + { name: 'insert', items: ['Table', 'HorizontalRule', 'SpecialChar'] }, { name: 'styles', items: ['Format', 'Font', 'FontSize'] }, { name: 'colors', items: ['TextColor', 'BGColor'] }, - { name: 'tools', items: ['Maximize', 'ShowBlocks'] } - ], - removeButtons: '', - allowedContent: true, - entities: false, - basicEntities: false, - fillEmptyBlocks: false + { name: 'tools', items: ['Maximize'] } + ] }); } catch (e) { console.error('CKEditor replace failed:', e);