<h4>Directory Module — Fatal SQL & Runtime Fixes</h4><ul><li><strong>CRITICAL Fixed:</strong> Fatal error on page load — SQL query in inc_directory_manager.php (line 93) used <code>SELECT *</code> with <code>GROUP BY wc.company_key</code> violating MySQL ONLY_FULL_GROUP_BY mode. Rewrote query to select only <code>wc.company_key</code> since the purpose is just checking if user has organizations (existence check, not data retrieval). Both UNION branches fixed.</li><li><strong>CRITICAL Fixed:</strong> Fatal error in getAllOrganizationsOfUser (OrganizationClass.php) — same ONLY_FULL_GROUP_BY violation. Rewrote using subquery with <code>ANY_VALUE()</code> for non-grouped columns + explicit column selection for the outer join.</li><li><strong>Fixed:</strong> Undefined array key 'actions' in inc_directory_manager.php line 7 — <code>$_GET['actions']</code> without isset. Added <code>?? ''</code>.</li><li><strong>Fixed:</strong> Undefined array key 'rid' in session check (line 30) — added null coalescing.</li><li><strong>Fixed:</strong> Undefined key 'uidfk' in OrganizationController.php line 85 — added fallback to <code>$_SESSION['uid']</code>.</li><li><strong>Fixed:</strong> Undefined key 'name' in check_company_name (line 396) — added fallback to <code>$request['company_name']</code>.</li><li><strong>Fixed:</strong> Undefined key 'sitelinkid' in DirectorySettingsClass.php line 80 — added session fallback.</li><li><strong>Fixed:</strong> SQL injection risk — used <code>intval()</code> on session acctid in raw query.</li></ul><p><strong>Files:</strong> inc_directory_manager.php, OrganizationClass.php, OrganizationController.php, DirectorySettingsClass.php</p><p><strong>Result:</strong> Page loads fully (14,272 lines, 0 errors). All tested endpoints return clean responses.</p>