Problem/Motivation

Wishlist API allows to set the Shipping Profile related to the wishlist. However, it is not possible to unset the value, given that method only allows to pass ProfileInterface objects as parameters.

Steps to reproduce

Create a Wishlist and a Profile
Set the profile $wishlist->setShippingProfile($profile)->save()
Try to unset the profile $wishlist->setShippingProfile(NULL)->save()
Exceptions thrown: TypeError: Drupal\commerce_wishlist\Entity\Wishlist::setShippingProfile(): Argument #1 ($profile) must be of type Drupal\profile\Entity\ProfileInterface

Proposed resolution

Allow to pass NULL as parameter to unset the profile.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plopesc created an issue. See original summary.

plopesc’s picture

Status: Active » Needs review

Update Status