Commit 677243fd authored by Damien McKenna's avatar Damien McKenna Committed by Damien McKenna
Browse files

Issue #3080665 by DamienMcKenna, Chris Matthews: Add status message when site...

Issue #3080665 by DamienMcKenna, Chris Matthews: Add status message when site is in maintenance mode that no meta data will be output.
parent 80e90070
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx
  regular title tag.
#3101567 by DamienMcKenna: Update migrations/state/metatag.migrate_drupal.yml
  for recent changes.
#3080665 by DamienMcKenna, Chris Matthews: Add status message when site is in
  maintenance mode that no meta data will be output.


Metatag 8.x-1.10, 2019-08-29
+2 −0
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ Standard usage scenario
       enabled for this entity, select "Users may translate this field" to use
       Drupal's translation system.

Please note: no meta tags will be output while the site is in maintenance mode.


Simplify the content administration experience
--------------------------------------------------------------------------------
+11 −0
Original line number Diff line number Diff line
@@ -22,6 +22,17 @@ function metatag_requirements($phase) {
  $requirements = [];

  if ($phase == 'runtime') {
    // Note that no meta tags will be output while the site is in maintenance
    // mode.
    if (\Drupal::state()->get('system.maintenance_mode')) {
      $requirements['metatag_maintenance_mode'] = [
        'severity' => REQUIREMENT_WARNING,
        'title' => 'Metatag',
        'value' => t('Not enabled while in maintenance mode'),
        'description' => t('Please note that while the site is in maintenance mode none of the usual meta tags will be output.'),
      ];
    }

    // Recommend the Schema.org Metatag module.
    if (!\Drupal::moduleHandler()->moduleExists('schema_metatag')) {
      $requirements['metatag_schema'] = [
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ class MetatagSettingsForm extends ConfigFormBase {
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    drupal_set_message($this->t('Please note that while the site is in maintenance mode none of the usual meta tags will be output.'));

    $settings = $this->config('metatag.settings')->get('entity_type_groups');

    $form['entity_type_groups'] = [
+9 −0
Original line number Diff line number Diff line
@@ -140,4 +140,13 @@ class MetatagDefaultsListBuilder extends ConfigEntityListBuilder {
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    drupal_set_message($this->t('Please note that while the site is in maintenance mode none of the usual meta tags will be output.'));

    return parent::render();
  }

}