Problem/Motivation

Let's suppose you wish to to get absolute URL to a product variation, according to documentation, you should be able to do this:
$dataProduct->toUrl('canonical', ['absolute' => TRUE])->toString();
But it won't work because ProductVariation::toUrl() method overrides the $options passed in parameter.
Little a 1 character patch is necessary. I will attach it !

Proposed resolution

Merge passed $options and default built options in the toUrl().

Remaining tasks

- patch
- review

User interface changes

- none

API changes

- none, since it should work as per documentation.

Data model changes

- none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dom. created an issue. See original summary.

Dom.’s picture

Assigned: Dom. » Unassigned
Status: Active » Needs review
Issue tags: +Novice
FileSize
551 bytes

Patch attached
One character patch literally ;)

  • bojanz committed 1d0aaf9 on 8.x-2.x authored by Dom.
    Issue #3015767 by Dom.: ProductVariation->toUrl() overrides passed $...
bojanz’s picture

Status: Needs review » Fixed

Sometimes one character makes a difference :)

Thanks!

Status: Fixed » Closed (fixed)

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