I ran into this issue when trying to set a Link field to null. I could correctly set it with:
$wrapper->{$link_field}->set(array('url' => NULL));
or
$wrapper->{$link_field}->set(NULL);
But I could not set it with
$wrapper->{$link_field}->url->set(NULL);

When I dug into the code, I saw the reason for this. The link_field_property_info_callback() function was only considering URL and Title's individual requirement rather also including the field's requirement.

CommentFileSizeAuthor
#2 2675568-1.patch854 bytespianomansam
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pianomansam created an issue. See original summary.

pianomansam’s picture

Status: Active » Needs review
FileSize
854 bytes

Here's a patch that solves this problem for me.

pianomansam’s picture

Title: Entity URL and Title property required values incorrectly set » Whether URL and Title entity properties are required is incorrectly determined
Chris Matthews’s picture

Status: Needs review » Reviewed & tested by the community

The 4 year old patch in #2 to link.module applied cleanly to the latest link 7.x-1.x-dev and solves this problem for me as well.

Checking patch link.module...
Hunk #1 succeeded at 1761 (offset 308 lines).
Applied patch link.module cleanly.
pifagor’s picture

  • pifagor committed c9c29fa on 7.x-1.x authored by pianomansam
    Issue #2675568 by pianomansam, Chris Matthews, pifagor: Whether URL and...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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