Fix: CKEditor console error - remove unavailable pagebreak plugin

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
This commit is contained in:
DevSoftTech Server 2026-06-07 11:14:48 +05:30
parent d025111bcc
commit 8461cae263

View File

@ -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,