I'm using CCK 6.x-3.x-dev dated 1300406575 including Filefield module 6.x-3.9.

I'm also using Automatic Nodetitles 6.x-1.2.

I've got a filefield that is setup as not required with a minimum resolution and a default image.

Scenario 1
I create a new node, complete the form, select an image that is the appropriate resolution - node is created as expected.

Scenario 2
I create a new node, complete the form, do not submit an image - node is created as expected using the default image.

Scenario 3
I create a new node, complete the form, select an image that is too small - I get an error telling me it's too small. I don't select a new image - I submit the form - I get a mysql error telling me it's trying to insert NULL for the fid in my content type table. Also, a blank node is created with the correct title derived from a CCK text field which is being used by Automatic Nodetitle to create the node title. If I edit the node, the only data that exists in the record is the actual node title, not even the CCK textfield that was used to derive the node title.

Scenario 4
Like Scenario 3 I create a new node with an image that is too small. Instead of just submitting it without an image, I select an image that is the appropriate size - node is created as expected.

The question is, is this a bug? Why doesn't it recognize the form is being resubmitted after an error and now the filefield has no value so use the default image?

Is it the Automatic NodeTitle module? I haven't tried disabling it yet, but perhaps it's trying to create the node prematurely and because the filefield module hasn't told it to use 0 as the fid, it fails when it tries to insert the data into the content type table.

Any help would be great.

Thanks,
Howie

Comments

aviddv1’s picture

Title: Filefield with default images passes null value - cause query error » Filefield with default images passes null value - causing query error
aviddv1’s picture

Looks like something strange happened in the table. The fid field was set to be a key and to NOT allow null values. Not sure if this happen after modifying the field several times or maybe something with the last dev build of cck and the filefield module, but it appears that allowing null values and removing the field as key did the trick.

Howie

avpaderno’s picture

Status: Active » Closed (outdated)
Issue tags: -file, -FileField, -automatic node titles, -MySQL error, -default image

I am closing this issue, since it's for a Drupal version not supported.