line 1060 of cck/content.module

Comments

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new2.54 KB

patch also fixes some white space issues.

dsayswhat’s picture

StatusFileSize
new2.64 KB
if(isset($node->{$field_name}[0][$column])) {
  $record[$attributes['column']] = $node->{$field_name}[0][$column];
}

That call to isset() fails when the value of a field is set to null.

When you empty a textarea, and click submit, of that textfield on the form, $node->{$field_name}[0][$column], it comes in on the form as an empty string.

However, CCK sets those fields to null during the call to 'content_set_empty' in content.module:726 (or thereabouts).

Setting those fields to null trips 'isset', and we end up not being able to save fields that have legitimate empty values anymore. You can edit your textfield, but not empty it.

Therefore, we probably need to explicitly test using is_null(), to allow for fields that are present but empty.

I've attached a patch modified to include an is_null test...I don't know if there's any wider-ranging implications here that might cause further bugs, but it allows me to clear fields and successfully save them.

mikeytown2’s picture

StatusFileSize
new2.63 KB

What about something like this.

adammalone’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Old issue but I just stumbled upon it and #3 seems to fix the issue. Might as well mark as RTBC for D6 sites still out there with this issue.