Loading modules/simple_sitemap_engines/src/Form/FormHelper.php +28 −24 Original line number Diff line number Diff line Loading @@ -46,10 +46,10 @@ class FormHelper extends BaseFormHelper { : 0, ]; if ($this->entityCategory === 'instance') { // If existing form entity is unpublished on load, assume it is a draft // and uncheck IndexNow. Check IndexNow when changing publishing status. if ($this->entityCategory === 'instance' && !$this->entityIsNew() if (!$this->entityIsNew() && $form_fragment['index_now']['#default_value'] && isset($form_fragment['status']) && empty($form_fragment['status']['widget']['value']['#default_value'])) { Loading @@ -61,8 +61,7 @@ class FormHelper extends BaseFormHelper { // If form entity is new, only check IndexNow when publishing status // is checked. if ($this->entityCategory === 'instance' && $this->entityIsNew() if ($this->entityIsNew() && $form_fragment['index_now']['#default_value'] && isset($form_fragment['status'])) { $form_fragment['index_now']['#states'] = [ Loading @@ -71,7 +70,6 @@ class FormHelper extends BaseFormHelper { } // Sensibly place the IndexNow checkbox. if ($this->entityCategory === 'instance') { $form_fragment['index_now']['#group'] = 'footer'; if (isset($form_fragment['status']['#weight'])) { $form_fragment['index_now']['#weight'] = $form_fragment['status']['#weight'] + 10; Loading @@ -79,6 +77,12 @@ class FormHelper extends BaseFormHelper { elseif (isset($form['actions']['submit']['#weight'])) { $form_fragment['index_now']['#weight'] = $form_fragment['actions']['submit']['#weight'] - 1; } // Remove access to IndexNow override checkbox if no verification key has // been added. if (SimplesitemapEnginesForm::getKeyLocation() === NULL) { $form_fragment['index_now']['#access'] = FALSE; } } return $this; Loading Loading
modules/simple_sitemap_engines/src/Form/FormHelper.php +28 −24 Original line number Diff line number Diff line Loading @@ -46,10 +46,10 @@ class FormHelper extends BaseFormHelper { : 0, ]; if ($this->entityCategory === 'instance') { // If existing form entity is unpublished on load, assume it is a draft // and uncheck IndexNow. Check IndexNow when changing publishing status. if ($this->entityCategory === 'instance' && !$this->entityIsNew() if (!$this->entityIsNew() && $form_fragment['index_now']['#default_value'] && isset($form_fragment['status']) && empty($form_fragment['status']['widget']['value']['#default_value'])) { Loading @@ -61,8 +61,7 @@ class FormHelper extends BaseFormHelper { // If form entity is new, only check IndexNow when publishing status // is checked. if ($this->entityCategory === 'instance' && $this->entityIsNew() if ($this->entityIsNew() && $form_fragment['index_now']['#default_value'] && isset($form_fragment['status'])) { $form_fragment['index_now']['#states'] = [ Loading @@ -71,7 +70,6 @@ class FormHelper extends BaseFormHelper { } // Sensibly place the IndexNow checkbox. if ($this->entityCategory === 'instance') { $form_fragment['index_now']['#group'] = 'footer'; if (isset($form_fragment['status']['#weight'])) { $form_fragment['index_now']['#weight'] = $form_fragment['status']['#weight'] + 10; Loading @@ -79,6 +77,12 @@ class FormHelper extends BaseFormHelper { elseif (isset($form['actions']['submit']['#weight'])) { $form_fragment['index_now']['#weight'] = $form_fragment['actions']['submit']['#weight'] - 1; } // Remove access to IndexNow override checkbox if no verification key has // been added. if (SimplesitemapEnginesForm::getKeyLocation() === NULL) { $form_fragment['index_now']['#access'] = FALSE; } } return $this; Loading