I'm having an issue where I'm trying to output an integer CCK field in an ATOM feed. However, if the value of the field is '0', the field gets omitted altogether for the given entry.

Here's a patch that seems to address that.

However, it doesn't resolve a separate but related issue: If you check "hide if empty" but leave unchecked the option "count 0 as empty", the '0' values still get omitted. That issue may require a more thorough patch.

This patch is taken against the latest 6.x-1.x dev version and may not be complete in that the other view styles (defined in views_rdf.module, views_json.module, views_xhtml.module, etc) may be using the same logic in their treatment of "empty" values and how they are defined by the view.

CommentFileSizeAuthor
views_xml.module.diff950 bytesankur
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

allisterbeharry’s picture

Assigned: Unassigned » allisterbeharry

Thanks for the patch, I think the general case has to do with the way the module gets info about each field from Views, and unhandled cases when 'exclude' may be selected for empty fields but this test is modified by certain other field options. This will be fixed in the next release.

Dmitriy.trt’s picture

subscribing

kenorb’s picture

Assigned: allisterbeharry » Unassigned
Issue summary: View changes