Commit f94a4c2e authored by alexpott's avatar alexpott

Issue #2760557 by larowlan, jibran: LinkItem::getUrl ignores the value of options

parent 2bb04688
......@@ -169,7 +169,7 @@ public static function mainPropertyName() {
* {@inheritdoc}
*/
public function getUrl() {
return Url::fromUri($this->uri);
return Url::fromUri($this->uri, $this->options);
}
/**
......
......@@ -78,6 +78,13 @@ public function testLinkItem() {
$entity->field_test->title = $title;
$entity->field_test->first()->get('options')->set('query', $parsed_url['query']);
$entity->field_test->first()->get('options')->set('attributes', array('class' => $class));
$this->assertEquals([
'query' => $parsed_url['query'],
'attributes' => [
'class' => $class,
],
'external' => TRUE,
], $entity->field_test->first()->getUrl()->getOptions());
$entity->name->value = $this->randomMachineName();
$entity->save();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment