I'm trying to use this the easy way, with the existing UI. I'm adding a single textfield and a single textarea to a filefield (image). Everything looks as expected, except that the values I enter don't get saved in the node, or at least they don't appear to -- they disappear from the node edit form once I save them. Should this be working out of the box, or does it always require some coding?
I'm using CCK 6.x-2.7 and have tried with both 6.x-4.0-alpha2 and 6.x-3.2. Both seem to behave identically.
I have to admit I don't understand the significance of the key value pairs. The value is clearly being used as the field's display name. Does it matter what text I use for the key?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | imagefield_extended-850766-8.patch | 1.24 KB | hitfactory |
| #6 | imagefield_extended-850766-6.patch | 1.24 KB | hitfactory |
| #2 | pos_node_form.txt | 66.61 KB | rubymuse |
Comments
Comment #1
alan d. commentedMaybe?! I'm traveling in the Americas and I do not have access to a test environment. Try keeping the pairs as simple ascii (a-z)
Eg: on my travel site:
copyright|The copyright info
license|License info
author|Photographer
date|Date taken
url|Website
caption|Caption
Then edit the content type page to activate the fields on the desired types & pick the field type (This may be the step you are missing)
The fields should appear on pages of that content type.
Close if it helps
Cheers
Alan
Comment #2
rubymuse commentedThanks for the quick response despite traveling. (And thanks for the module!)
I've done the things you mentioned, but still no go, though it's now displaying the field content when I view the node: I'd forgotten to make a selection on the 'Display fields' tab, which is now set to 'Image, with additional fields'.
But it's still not showing the values on the node edit form, so I've no way to modify existing field values. Below is a portion of the form object (the whole thing is attached). The CCK field is field_pos_item, and the extended fields are posname, posblurb, and poscost. All the fields are displayed on the node edit form, but the values are empty. Note that it doesn't show the 'alt' or 'title' values either. Is there something else I should be doing for these values to render in the form? Thanks again...
[field_pos_item] => Array
(
[#theme] => content_multiple_values
[#title] => Item image
[#required] => 1
[#description] => You will be prompted for title, description and cost after you upload the image. Image can be of any size; the system will resize as necessary.
[0] => Array
(
[#title] =>
[#type] => imagefield_widget
[#default_value] => Array
(
[fid] => 46
[list] => 1
[data] => Array
(
[fid] => 46
[width] => 16
[height] => 16
[duration] => 0
[audio_format] =>
[audio_sample_rate] => 0
[audio_channel_mode] =>
[audio_bitrate] => 0
[audio_bitrate_mode] =>
[tags] => Array
(
)
[alt] => dummy alt text
[title] => dummy title text
[posname] => Array
(
[body] => Lovely icon
[format] =>
[style] => textfield
)
[posblurb] => Array
(
[body] => This is so lovely, this icon. 'Tis.
[format] =>
[style] => textarea
)
[poscost] => Array
(
[body] => 30
[format] =>
[style] => textfield
)
)
[uid] => 1
[filename] => favicon2.gif
[filepath] => files/pos/favicon2.gif
[filemime] => image/gif
[filesize] => 1091
[status] => 1
[timestamp] => 1278875608
)
Comment #3
alan d. commentedI would use the newer alpha version, this saves issues with the two different field types. Let me know if this helps...
Comment #4
attiks commentedI'm having the same problem, I first had to change
if (!empty($widget['custom_'. $key])) {toif (isset($widget['custom_'. $key])) {because otherwise nothing was added.Now the fields are in the $element, but they don't show on the node/edit form
Comment #5
alan d. commentedHow did you go with this? The Custom Formatters module, http://drupal.org/project/custom_formatters, should enable you to handle the last step in the chain without any additional programming.
Comment #6
hitfactory commentedAlso applies to 6.4.1.
The problem is that imagefield_extended_widget_process runs before Filefield, which initializes $element['data'].
Patch attached updates module weight to 1. Filefield's is 0. I don't really understand the numbering system for update functions so that might need tweaking.
Comment #7
alan d. commentedI hate how Drupal installs things... Anyway, the patch looks good, except that the number would be 6401 rather than 6500. These are based on the main version, minor version and then 00 to 99 for the updates themselves.
This does appear to be an easy fix, but changing the system weight could upset other modules, so any testers to have a play would be great. It is a bit hard to do it myselve from a cybercafe in Mexico!
Comment #8
hitfactory commentedRe-attaching with correct update number.
Filefield Sources runs with weight 5 so seems like it's the way to go for modules altering the filefield/imagefield widget.
Comment #9
attiks commentedGood catch, fixes all my problems
Comment #10
alan d. commentedI think that this patch could lead to a whole array of related bugs in other modules that alter FileField fields. I'm marking as "won't fix" but adding a link to http://drupal.org/project/util module from the front page to allow users to fix this themselves if the need arises. (This bug appears to effects less than 0.1% of users)
Comment #11
rubymuse commentedI had patched this, then upgraded to Imagefield Extended 6.x-4.1 and the problem reappeared. Extended data was not being saved at all. So I made the change suggested by @Attiks in comment #4, and that fixed the data saving. I then re-applied the patch to get the data to show in the node edit form, but no luck. I've got filefield weight at 0, imagefield_extended at 2. Does anyone else still have this problem or am I all alone?
Comment #12
rubymuse commentedJust updated cck and filefield and voila -- it's working fine now.