Blank Filefield Causes Deployment Error

heckacopter213 - October 23, 2009 - 23:10
Project:Deployment
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:heckacopter213
Status:patch (to be ported)
Description

I have a CCK type called "Feature" that has an optional image field. If I create a Feature and attach an image to it, deployments work fine. However, if I attempt to deploy a Feature with no image attached, I get the following error in the Deployment Log Details:

filefield File: Error Could not create destination directory for file.

I'm assuming the code needs to check for a value in the image field before attempting to deploy it.

#1

heckacopter213 - October 24, 2009 - 00:18
Assigned to:Anonymous» heckacopter213
Status:active» patch (to be ported)

Ok, I found the problem was with filefields that accept multiple values. In this case, the value of $node->{$field} would not be empty, but would instead contain an empty array. I've attached a patch that fixes the problem.

AttachmentSize
deploy-filefield-multiple.patch 849 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.