diff --git a/src/EntityAnalyser.php b/src/EntityAnalyser.php index cae8176..07917de 100644 --- a/src/EntityAnalyser.php +++ b/src/EntityAnalyser.php @@ -258,4 +258,5 @@ class EntityAnalyser { 'description' => 'meta', ]; } -} \ No newline at end of file + +} diff --git a/src/Form/AnalysisFormHandler.php b/src/Form/AnalysisFormHandler.php index 193c140..725102f 100644 --- a/src/Form/AnalysisFormHandler.php +++ b/src/Form/AnalysisFormHandler.php @@ -28,7 +28,7 @@ class AnalysisFormHandler implements EntityHandlerInterface { /** * SeoPreviewFormHandler constructor. * - * @param \Drupal\yoast_seo\EntityAnalyser + * @param \Drupal\yoast_seo\EntityAnalyser $entity_analyser * The entity analyser. */ public function __construct(EntityAnalyser $entity_analyser) { @@ -94,11 +94,12 @@ class AnalysisFormHandler implements EntityHandlerInterface { '#attributes' => [ 'class' => ['yoast-seo-preview-submit-button'], // Inline styles are bad but we can't reliably use class order here. - 'style' => 'display: none' + 'style' => 'display: none', ], '#ajax' => [ 'callback' => [$this, 'analysisSubmitAjax'], ], ]; } + } diff --git a/src/Form/ConfigForm.php b/src/Form/ConfigForm.php index 2e31fd4..575183a 100644 --- a/src/Form/ConfigForm.php +++ b/src/Form/ConfigForm.php @@ -4,7 +4,6 @@ namespace Drupal\yoast_seo\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\yoast_seo\FieldManager; use Drupal\yoast_seo\SeoManager; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Plugin/Field/FieldWidget/YoastSeoWidget.php b/src/Plugin/Field/FieldWidget/YoastSeoWidget.php index 2913b09..95e5226 100644 --- a/src/Plugin/Field/FieldWidget/YoastSeoWidget.php +++ b/src/Plugin/Field/FieldWidget/YoastSeoWidget.php @@ -190,8 +190,6 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa 'base_root' => $base_root, // Set up score to indiciator word rules. 'score_status' => $score_to_status_rules, - // Set up our analysis endpoint. - 'analysis_endpoint' => Url::fromRoute('yoast_seo.entity_preview')->toString(), ]; // Set up the names of the text outputs. diff --git a/src/SeoManager.php b/src/SeoManager.php index fd43dbb..5228996 100644 --- a/src/SeoManager.php +++ b/src/SeoManager.php @@ -4,7 +4,6 @@ namespace Drupal\yoast_seo; use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\yoast_seo\Form\AnalysisFormHandler; use Symfony\Component\Yaml\Yaml; /** @@ -171,7 +170,6 @@ class SeoManager { * The bundle of the entity to disable. */ public function disableFor($entity_type_id, $bundle) { - // TODO: Figure out if we need to detach the form handler $this->fieldManager->detachSeoFields($entity_type_id, $bundle); } diff --git a/tests/src/Functional/ConfigurationPageTest.php b/tests/src/Functional/ConfigurationPageTest.php index 1b26725..fd6fdbc 100644 --- a/tests/src/Functional/ConfigurationPageTest.php +++ b/tests/src/Functional/ConfigurationPageTest.php @@ -94,7 +94,7 @@ class ConfigurationPageTest extends BrowserTestBase { $this->assertTrue($checked, "Expected Real-Time SEO module to be enabled for 'Article'"); // Check that the SEO analyzer shows up on the article add page. - $this->drupalGet('node/add/article'); + $this->drupalGet('/node/add/article'); $this->assertSession()->pageTextContains('Real-time SEO for drupal'); } diff --git a/yoast_seo.module b/yoast_seo.module index 0d784ce..cb6ba87 100644 --- a/yoast_seo.module +++ b/yoast_seo.module @@ -84,13 +84,13 @@ function yoast_seo_theme() { * @see \Drupal\Core\Entity\Annotation\EntityType */ function yoast_seo_entity_type_build(array &$entity_types) { - /** @var \Drupal\yoast_seo\SeoManager $seo_manager */ + /* @var \Drupal\yoast_seo\SeoManager $seo_manager */ $seo_manager = \Drupal::service('yoast_seo.manager'); // Set the handler for all supported types. $supported_types = $seo_manager->getSupportedEntityTypes(); - /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ + /* @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ foreach ($entity_types as &$entity_type) { if (isset($supported_types[$entity_type->id()])) { if (!$entity_type->hasHandlerClass('yoast_seo_preview_form')) {