Problem/Motivation
In FieldWebTest we have:
// @fixme: The actual result is node/123?foo#bar so views has a bug here.
// $this->assertSubStringExists(decode_entities($result), decode_entities($expected_result));
So basically we are expecting node/123?foo#bar
but we currently get node/123?foo=#bar
. The problem occurs are we parse the URL when then makes an empty query string parameter into 'param' => ''
. So an empty string. in UrlHelper::buildQuery() anything other than NULL is added to the query string with $key . '=' . $value
.
It would be nice to uncomment out this code once again.
Proposed resolution
In FieldPluginBase::renderAsLink():
Use the parsed url path, and deal with just the array of parsed query parameters. We currently try to deal with array and the original string by using the raw path value in $path. So overwrite the parsed value from url parsing to the $path variable too.
Uncomment failing test assertion and all *should* be well.
Remaining tasks
Patch
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
vdc.url-parsing-FieldPluginBase.patch | 3.41 KB | damiankloip | |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedvdc.url-parsing-FieldPluginBase.patch queued for re-testing.
Comment #2
dawehnerNice!
Did we considerd to use array_filter with a callback instead?
Comment #3
damiankloip CreditAttribution: damiankloip commentedHmm, I thought that originally but sadly we need the key and the value to check the token replacement:
Comment #4
dawehnermeh, but well, this is already an improvement. Thank you damian!
Comment #5
alexpottCommitted 973fd26 and pushed to 8.0.x. Thanks!
Comment #7
alexpott