A CCK fieldgroup whose only child element is a computed field will be displayed in node edit forms. It shows up as an empty field. Normally CCK fieldgroups which contain only inaccessible child elements are not displayed.

I gather that this is because the computed field 'widget' is effectively a no-op, but there's no other property set to indicate that the computed field should not be displayed in the edit form.

Setting #access => false for the computed field(s) in question seems to prevent them from being displayed; I'm not sure if this will cause other problems.

This is related to the CCK issue #159099: Empty field handling

Comments

Moonshine’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Well denying #access would likely cause some trouble in other areas, but if that's running well for you stick with it. :) I guess I can't really see where a computed field (which isn't entered via a form) would need to be in a Fieldgroup though. If you are just wanting the display output to be wrapped in theme_fieldset() then that would probably be easier to attack from the theme side of things.

intuited’s picture

It's been a while, but IIRC I wanted to be able to be able to use the expand/hide JS action for a lengthy computed field, some kind of customized preview box. You might be right about the theming approach being more appropriate.

#349548: Conditional result for hook_content_is_empty() seems to be related. I've not been working on Drupal stuff at all lately, so I'm not really set up to test this and see if there's still a problem.

Moonshine’s picture

Interesting, thanks. I'll take a peek.

mmjvb’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)