Posted by joachim on July 17, 2012 at 2:26pm
3 followers
| Project: | Drupal Commerce |
| Version: | 7.x-1.x-dev |
| Component: | Product |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
entity_extract_ids() should produce a NULL if the entity has no ID yet.
However, in hook_field_attach_form() with the product form, I get an empty string.
(Marking as major as it's going to cause problems with #1050872: Integrate with the Flag module, which is how I've encountered it.)
Comments
#1
I'm guessing this affects all our entity types then; just need to look in the create method of our controllers to fix 'em.
I don't think anything in Commerce itself is so finicky as to expect NULL vs. ''. I wonder why the code reading this stuff isn't just using empty(). : ?
#2
Get 'em, test bot.
#3
The last submitted patch, 1689538-2.null_ids.patch, failed testing.
#4
Meh, that was a silly assertion.
#5
I don't see any place in Commerce where we make any assertions against IDs stronger than ==, so NULL or '' won't matter. Going to go ahead and commit the patch in #4.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.