Closed (fixed)
Project:
ImageField
Version:
6.x-3.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2011 at 12:06 UTC
Updated:
9 Aug 2011 at 14:16 UTC
Hello.
I have seen that when I build a feature with a node type, if the node has one imagefield with a default field the feature saves this:
'default_image' => array(
'filename' => 'default_photo.png',
'filepath' => 'sites/domain/files/imagefield_default_images/default_photo_0.png',
'filemime' => 'image/png',
'source' => 'default_image_upload',
'destination' => 'sites/domain/files/imagefield_default_images/default_photo_0.png',
'filesize' => 626,
'uid' => '1',
'status' => 1,
'timestamp' => 1310495834,
'origname' => '',
'fid' => '109',
),
The problem is that if the development server is:
dev.domain.com
staging is
stg.domain.com
and the main is
domain.com
The feature always tries to get the default image from the feature's path and then delivers an error.
Comments
Comment #1
quicksketchWhat are you suggesting here?
ImageField (like all other fields), doesn't really know about the existence of Features. Seems like maybe this request should be moved over there.
Comment #2
oskar_calvo commentedAs we have 'files_directory_path()', maybe the best path to store should be '/imagefield_default_images/imagename.wathever';
Features only take the configuration from the database and bring it to code.
The same problem will have whatever that user backup an migrate to develop in local and run in another server.
Thanks
Oskar
Comment #3
quicksketchAs with dozens of other requests, what you're describing is "just the way Drupal works" when it comes to storing file directory paths. ALL files are always stored by their full path, including the files directory path. Look at the "files" table in your database for examples.
This has been fixed in Drupal 7 with the introduction of paths such as "public://directory/example.png".
Though really what should be stored in the database isn't the file path at all but just a file FID. In any case, it wouldn't help with exporting features.
Comment #4
oskar_calvo commentedThe diferent or the problem is that a database can be update with an easy query, if you have a feature from a node->type, and a default image with it.
You must use all the time the default directory to devel, staging and production. The only way is to be patching all the time the feature when is going to be done one deployment and the features it's around.
anyway, thanks for your time.
Oskar
Comment #5
oskar_calvo commentedA person give a really simple solution.
Move files out of default configuration, so there will be not problems with the paths.
Our option is
/dupal/sites/filesOskar
Comment #6
oskar_calvo commented