Problem/Motivation

Currently Drupal.org test bot fails to run all tests successfully. For example, see this test or this test.

The issue seems to be introduced in #1827854: W3C HTML5 Validation error with PHP array-based query-strings built with url() containing [ ] characters (eg views filters).

Proposed resolution

Update the tests to comply with HTML5 URL query standard.

Comments

Spleshka created an issue. See original summary.

spleshka’s picture

Assigned: Unassigned » spleshka

I'll check if I able to resolve this issue quickly.

spleshka’s picture

Observation: on the local php 7.1 it passes without any issues.

spleshka’s picture

New observation: it's not related to php version, it's related to Drupal core version. 8.3.2 didn't have this issue, while latest 8.3.x. is causing it.

spleshka’s picture

The failure happens in JsonApiFunctionalTest test, method testRead(). This code causes the issue:

    $collection_output = Json::decode($this->drupalGet('/jsonapi/node/article', [
      'query' => ['page' => ['offset' => 3]],
    ]));
    ...
    $this->assertContains('page[offset]=53', $collection_output['links']['next']);

In Drupal 8.3.2, $collection_output['links']['next'] looks like this:

http://hostname/jsonapi/node/article?page[offset]=53&page[limit]=50

In Drupal 8.3.x it looks like this:

http://hostname/jsonapi/node/article?page%5Boffset%5D=53&page%5Blimit%5D=50

Looks like something is broken in serialization. Keep digging.

spleshka’s picture

I've found the issue which broke our tests, it's this one: #1827854: W3C HTML5 Validation error with PHP array-based query-strings built with url() containing [ ] characters (eg views filters).
So it's not a bug, it's a feature and our tests have to comply with this.

spleshka’s picture

Issue summary: View changes
spleshka’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

Attaching patch which resolves the issue.

e0ipso’s picture

Status: Needs review » Fixed

That's fair enough.

  • e0ipso committed e75187a on 8.x-1.x authored by Spleshka
    test(Functional): Ammend failing test in the dev branch (#2877589 by...
e0ipso’s picture

Thanks for the debugging and the fix @Spleshka!

spleshka’s picture

Great, thanks Mateu for the fast turnaround

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.