Skip to content
Snippets Groups Projects
Commit ea71ff8b authored by catch's avatar catch
Browse files

Issue #3486195 by longwave, alexpott, dmundra: An update to...

Issue #3486195 by longwave, alexpott, dmundra: An update to symfony/http-foundation plus a trailing space took down the views UI
parent e7631fe8
No related branches found
No related tags found
2 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated
Pipeline #335926 passed with warnings
Pipeline: drupal

#335936

    Pipeline: drupal

    #335932

      Pipeline: drupal

      #335929

        +2
        ...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
        use Drupal\Core\Url; use Drupal\Core\Url;
        use Drupal\views\Views; use Drupal\views\Views;
        use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
        use Symfony\Component\HttpFoundation\Exception\BadRequestException;
        use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
        use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException; use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
        use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
        ...@@ -464,7 +465,7 @@ public function getDisplayDetails($view, $display) { ...@@ -464,7 +465,7 @@ public function getDisplayDetails($view, $display) {
        if ($path && (!str_contains($path, '%'))) { if ($path && (!str_contains($path, '%'))) {
        // Wrap this in a try/catch as trying to generate links to some // Wrap this in a try/catch as trying to generate links to some
        // routes may throw a NotAcceptableHttpException if they do not // routes may throw an exception, for example if they do not
        // respond to HTML, such as RESTExports. // respond to HTML, such as RESTExports.
        try { try {
        if (!parse_url($path, PHP_URL_SCHEME)) { if (!parse_url($path, PHP_URL_SCHEME)) {
        ...@@ -476,7 +477,7 @@ public function getDisplayDetails($view, $display) { ...@@ -476,7 +477,7 @@ public function getDisplayDetails($view, $display) {
        $url = Url::fromUri("base:$path"); $url = Url::fromUri("base:$path");
        } }
        } }
        catch (NotAcceptableHttpException $e) { catch (BadRequestException | NotAcceptableHttpException $e) {
        $url = '/' . $path; $url = '/' . $path;
        } }
        ......
        ...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
        use Drupal\Core\Link; use Drupal\Core\Link;
        use Drupal\Core\Url; use Drupal\Core\Url;
        use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
        use Symfony\Component\HttpFoundation\Exception\BadRequestException;
        use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException; use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
        /** /**
        ...@@ -261,14 +262,14 @@ protected function getDisplaysList(EntityInterface $view) { ...@@ -261,14 +262,14 @@ protected function getDisplaysList(EntityInterface $view) {
        $path = $display->getPath(); $path = $display->getPath();
        if ($view->status() && !str_contains($path, '%')) { if ($view->status() && !str_contains($path, '%')) {
        // Wrap this in a try/catch as trying to generate links to some // Wrap this in a try/catch as trying to generate links to some
        // routes may throw a NotAcceptableHttpException if they do not // routes may throw an exception, for example if they do not
        // respond to HTML, such as RESTExports. // respond to HTML, such as RESTExports.
        try { try {
        // @todo Views should expect and store a leading /. See: // @todo Views should expect and store a leading /. See:
        // https://www.drupal.org/node/2423913 // https://www.drupal.org/node/2423913
        $rendered_path = Link::fromTextAndUrl('/' . $path, Url::fromUserInput('/' . $path))->toString(); $rendered_path = Link::fromTextAndUrl('/' . $path, Url::fromUserInput('/' . $path))->toString();
        } }
        catch (NotAcceptableHttpException $e) { catch (BadRequestException | NotAcceptableHttpException $e) {
        $rendered_path = '/' . $path; $rendered_path = '/' . $path;
        } }
        } }
        ......
        ...@@ -183,4 +183,4 @@ display: ...@@ -183,4 +183,4 @@ display:
        display_plugin: page display_plugin: page
        position: 2 position: 2
        display_options: display_options:
        path: foobar path: 'foobar '
        ...@@ -37,6 +37,8 @@ public function testViewsUi(): void { ...@@ -37,6 +37,8 @@ public function testViewsUi(): void {
        */ */
        public function testNoDoubleEscaping(): void { public function testNoDoubleEscaping(): void {
        $this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
        $this->assertSession()->pageTextContains('sa_contrib_2013_035');
        $this->assertSession()->pageTextContains('Page (/foobar )');
        $this->assertSession()->assertNoEscaped('<'); $this->assertSession()->assertNoEscaped('<');
        $this->drupalGet('admin/structure/views/view/sa_contrib_2013_035'); $this->drupalGet('admin/structure/views/view/sa_contrib_2013_035');
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment