<ul><li><strong>CRITICAL FIX:</strong> Restructured Add/Update Category modal HTML — form tag was inside modal-body causing browser to auto-close the form, leaving submit buttons outside the form and making CRUD completely non-functional. Moved form to wrap both modal-body and modal-footer correctly.</li><li><strong>HIGH FIX:</strong> Undefined variable $lnkmodid in list_gallery_items.php and list_gallery_categories.php — PHP Warning was being injected into data-lnkmodid attribute breaking the Add buttons. Fixed with ?? null coalescing guards.</li><li><strong>HIGH FIX:</strong> Undefined variable $domain_name in list_gallery_items.php — added ?? guard to prevent PHP Warning injection.</li><li><strong>MEDIUM FIX:</strong> Operator precedence bug in inc_gallery_manager.php — $_SESSION['super_admin'] ?? false == 1 was evaluating 'false == 1' first (always false) before null coalescing. Fixed with explicit parentheses: ($_SESSION['super_admin'] ?? false) == 1.</li><li><strong>LOW FIX:</strong> Removed duplicate .on('change','#document_role_switch_update',...) event handler in custom_js.php — duplicate handler was binding the same event twice.</li><li><strong>LOW FIX:</strong> extract($getMediaInfoData) without empty guard in insert_update.php deleteMedia action — guarded with if(!empty($getMediaInfoData)).</li><li><strong>SPEED:</strong> Added index idx_gallery_item_fk on domain_tbl_media_gallery_items_media.GalleryItemID_fk — reduced media query from 642-row full scan to 3-row index lookup (119x improvement).</li><li><strong>VALIDATION:</strong> 0 PHP errors, 0 JS console errors, 0 network failures. Full CRUD cycle (Create/Read/Update/Delete for both Gallery Items and Categories) verified via Playwright browser automation.</li></ul>