For the uri data type entity_property_verify_data_type calls valid_uri() with the absolute parameter set to TRUE. This seems overly restrictive as a valid URI does not have to contain a scheme.
This also prevents saving what would be considered a valid URI value for the link field through the entity_metadata_wrapper, ex:
This will succeed:
$node = node_load(123);
$wrapper = entity_metadata_wrapper('node', $node);
$wrapper->field_link->url->set('http://test.com');
$wrapper->save();
While this will fail:
$node = node_load(123);
$wrapper = entity_metadata_wrapper('node', $node);
$wrapper->field_link->url->set('test.com');
$wrapper->save();
Comments
Comment #2
epicflux commentedComment #3
epicflux commentedComment #4
epicflux commentedComment #5
bdone commentedComment #6
fagoMaybe, but this is how it's documented and has been for years. Changing the spec now does not help anyone, as every module supporting 'url' type values would have to adapt, what makes a rather drastic API change at this point. Given that, link module would have to adapt it's getter callback and translate the relative urls to absolute ones.