In #3090414: Fix coding standards it was found the implementation of hook\_requirements is responsible for a lot of code style violations. However, it does basically nothing, with the meat of the function commented out. We need to assess whether we need anything from this and re-implement it; doing this is outside the scope of #3090414: Fix coding standards, where wil will simply remove it for now.
/** * Implements hook\_requirements(). */function flag\_requirements($phase) { $requirements = []; /* if ($phase == 'runtime') { if (\Drupal::moduleHandler()->moduleExists('translation') && !\Drupal::moduleHandler()->moduleExists('translation\_helpers')) { $requirements['flag\_translation'] = array( 'title' => t('Flag'), 'severity' => REQUIREMENT\_ERROR, 'description' => t('To have the flag module work with translations, you need to install and enable the <a href="http://drupal.org/project/translation\_helpers">Translation helpers</a> module.'), 'value' => t('Translation helpers module not found.'), ); } if (\Drupal::moduleHandler()->moduleExists('session\_api')) { if (file\_exists('./robots.txt')) { $flag\_path = url('flag') . '/'; // We don't use url() because this may return an absolute URL when // language negotiation is set to 'domain'. $flag\_path = parse\_url($flag\_path, PHP\_URL\_PATH); $robots\_string = 'Disallow: ' . $flag\_path; $contents = file\_get\_contents('./robots.txt'); if (strpos($contents, $robots\_string) === FALSE) { $requirements['flag\_robots'] = array( 'title' => t('Flag robots.txt problem'), 'severity' => REQUIREMENT\_WARNING, 'description' => t('Flag module may currently be used with anonymous users, however the robots.txt file does not exclude the "@flag-path" path, which may cause search engines to randomly flag and unflag content when they index the site. It is highly recommended to add "@robots-string" to your robots.txt file (located in the root of your Drupal installation).', array('@flag-path' => $flag\_path, '@robots-string' => $robots\_string)), 'value' => t('Search engines flagging content'), ); } } } } */ return $requirements;}
Assess whether we still need anything from this implementation and if so, re-implement it. In the current version of the module, it does nothing.
Requirements checks listed in site status report (?)
None.
None.