Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey,
I found this problem.
I have a field collection item that has a taxonomy, a date and a text field.
When using the class I do the following
$efq->entityCondition('entity_type', 'field_collection_item')
->entityCondition('bundle', 'field_content_setup')
->fieldCondition('field_content_date', 'value', $dates, 'IN')
->fieldCondition('field_content_term', 'tid', $tids, 'IN')
->addExtraField('field_content_date', 'value')
->addExtraField('field_content_term', 'tid');
I have 3 items on the database, on of which has no value for the textfield (not included here). This previous query returns all 3 items.
Now, doing this
$efq->entityCondition('entity_type', 'field_collection_item')
->entityCondition('bundle', 'field_content_setup')
->fieldCondition('field_content_date', 'value', $dates, 'IN')
->fieldCondition('field_content_term', 'tid', $tids, 'IN')
->addExtraField('field_content_text', 'value')
->addExtraField('field_content_date', 'value')
->addExtraField('field_content_term', 'tid');
I only get two items.
The reason is, the third item does not have a value.
Is there a way I could get it to return all 3 items and display that the third one has a null value in the textfield?
Regards,
Comment | File | Size | Author |
---|---|---|---|
#1 | Schermafbeelding 2017-10-08 om 15.23.16.png | 46.85 KB | RAWDESK |
#1 | Schermafbeelding 2017-10-08 om 15.20.44.png | 48.05 KB | RAWDESK |
Comments
Comment #1
RAWDESK CreditAttribution: RAWDESK for Colruyt Group Services commentedI'm experiencing the opposite effect.
My query result now receives node entities that no longer exist on the node table, in this case for example node 176 :
The field_estate_id 2533122 does exist on its respective table though :
My guess is in both cases, the additional query logic is somehow not applying the correct JOIN clause between node and field_% tables
Also have my doubts about correctness of node_delete() functions, as it should delete all linked field values:
https://api.drupal.org/comment/63428#comment-63428