Bug #23467 Bug Fixed

Fetching partial data from model wields inconsistent results

Version: 4.0.9 Reporter: Low

When using the ChannelEntry model to fetch entries, and using the Partial Data option to only select relevant fields, will give me inconsistent results. It is best shown via this video.

The main thing being that in some cases, you need to explicitly add channel_id to the fields list in order to fetch certain custom fields. In the video, I limit the fields to entry_id, channel_id, title, field_id_1, field_id_2, field_id_75. When I remove channel_id from the list, field_id_75 is removed as well.

In the debugger, I can see a query being generated with this WHERE clause, which looks wrong:

WHERE  ( 
    `Channel_channels`.`channel_id`  IN (NULL) 
)

Also, the custom fields are only added to the result set when the value is not NULL, where I expect the keys to always be present, possibly with a value of NULL.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases