themeExists('gin'); // Gin is installed everything's fine. if ($installed) { return $requirements; } global $install_state; // Check if Drupal should be installed and gin in is in the install profile. if (InstallerKernel::installationAttempted() && isset($install_state['profile_info']['themes']) && in_array('gin', $install_state['profile_info']['themes'], TRUE)) { return $requirements; } // Gin is not installed and it's not supposed to be installed. $requirements['gin'] = [ 'title' => t('Gin'), 'description' => t('The Gin Toolbar module works with Gin theme only'), 'severity' => REQUIREMENT_ERROR, ]; return $requirements; }