Hi,

I have a content type that has a number of fields that are for internal admin use only.. Mostly dates and a "computed_field"..

When a node is created these values need to have default values set..

If the content is created by staff users (with full permissions to the field) the defaults work perfectly.. If the content is created by a customer the values are empty which breaks other functionality..

I believe it should always accept defaults is specified regardless of field permissions because if the intention was for fields to be black the site builder wouldn't have specified a default value..

Is there a work around for this situation?

Thanks..

Comments

AaronBauman’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
jamix’s picture

The problem here, as I see it, is that field default values are actually used as default (initial) values for the form widgets. No field widget rendered on a form = no default value set.

A workaround could be setting the default value(s) using Rules by reacting on the "After saving new content" event.

AaronBauman’s picture

it's not necessary to have a widget in order to set a form value.
Field Permissions should set the default regardless of how the UI is presented.

mariacha1’s picture

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

I'm not seeing this behavior when I test with text fields -- setting a default value of "15" or "This is body text" resulted in the fields being populated even if the author couldn't access them. Logging in as an admin confirmed the values were set correctly.

Any chance this is a problem with computed or date fields? Any other factors that might be in play here?