Hi,

First and foremost - thanks for sharing the module.

I guess file description suppose to be part of the node (visible to anyone with the right permission), however I'm afraid I can't get the file description to appear in the node. Am I'm missing something or is it by-design?

File field configuration:
Default list value: listed
Description field: enabled

Regards,

CommentFileSizeAuthor
#30 310126.patch1.21 KBRobLoach
#29 310126.patch3.71 KBRobLoach
#28 310126.patch3.34 KBRobLoach
#19 filefield.patch732 bytesJax
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

roginald’s picture

Hi,

I really appreciate the work put into this module as well.

I noticed when using the module with the 'zen' theme that descriptions do not appear if i have multiple uploads enabled 'and' the number of files set to unlimited. However, if I set the # to a set amount, the description fields do show up. Pretty sure this problem does not occur in the Garland theme. Haven't tested any other themes.

Not sure if this is related, but I thought I'd mention it.

This is using alpha-4 version of filefield.

esadot’s picture

Thanks for the tip, unfortunately i can't pull it off. I've set the number of files to a specific number, played with the required and other configuration param. the problem persist. Garland theme + out of the box drupal 6.

KonstantinSh’s picture

I have the same problem. Description of files did not appear.

upupax’s picture

Same for me. I'm using Marinelli theme.

yurtboy’s picture

same here on garland

spiffyd’s picture

Title: File description » File description not displayed with enabled
Category: support » bug

This seems to be a bug.

fgarcia1103’s picture

Version: 6.x-3.0-alpha4 » 6.x-3.0-alpha5

I have the same problem with alpha5 version, I use A3 atlantis theme

dopry’s picture

Status: Active » Postponed (maintainer needs more info)

maybe the description isn't being displayed in the formatter. Which formatters are you guys using? how are you displaying the output? pure filefield or imagefield? I'm pretty sure description is not used in the filefield formatter.

fgarcia1103’s picture

I only have the filefield,date and link modules for CCK, I was create a new content type and I added a field for date, two text fields and the filefield for upload documents, when I introduce content based in this content type I can upload a document and a description for every document, but when save the content I only see the files, when return to the edit page the description is desapear. The input format for the content is "filtered HTML". I don't know what is the filefield formatter, the default list value is "listed", users can't configure the list value for documents and the description field is "active". Where can I find the filefield formatter?

esadot’s picture

Not sure what formatter is. I've installed drupal v6 + cck filefield, no other modules. Didn't do any customization. Out of the box.

File's description doesn't show in node.
File's description does show in node edit page.
Filefield display filed (admin/content/node-type/page/display) is set to label=above, teaser=generic file and full node=generic file.

fgarcia1103’s picture

I have the filefield display files with the same configuration

kosilko’s picture

same problem

spopovits’s picture

same problem
Description field is not saving values.
In content the only choice for my display that works is generic files (trying to display a list of pdf attachments) or views using cck fields available for node no content (description) fields available. In files type views none of the filefield fields are available.
sample of this is http://www.screenprocess.com/node/58

What additional information do you need and what is a formatter?

mshick’s picture

Likewise. I am seeing description, alt text, and title fields, but the values I input do not save. Completely fresh installation of Drupal 6.6, and latest non-devel CCK, Filefield, Imagefield, and ImageAPI, and nothing else. No errors are showing up anywhere.

mshick’s picture

Disabling the module "FileField Meta" solved the problem for me. I can now save input added to the ImageField description and other fields.

Unfortunately I think I will be needing FileField Meta for the project I'm working on...

kruser’s picture

I had the same bug with descriptions not showing only after enabling FileField Meta. If I disable FileField Meta then the descriptions worked again.

Anyone know of a way to make them work together?

spopovits’s picture

Disabling the filefield meta also worked for me, allowing the description to be saved and displayed.
Same question as #16?

Jax’s picture

Status: Postponed (maintainer needs more info) » Needs work

This uses the description to link to the file when it is available. Maybe it's better to check for something else to determine if the description needs to be used or maybe a completely new formatter is in order in stead of "Generic Files".

Jax’s picture

FileSize
732 bytes

Hmmm... my patch didn't got attached.

cmurockstar’s picture

I turned off meta and the descriptions are being saved, but not displayed... anywhere

(Drupal 6)

cmurockstar’s picture

so if you go into filefield_formatter.inc

you can change

return '

'. $icon . l($file['filename'], $url) .'

';

to

return '

'. $icon . l($file['data']['description'], $url) .'

';

It would be nice to have this as a toggle-able option.

kruser’s picture

Neither the patch or the mod in #21 have worked any differently for me.

With Filefield Meta enabled:
On the edit page, the description field doesn't "take" or stay in the input field upon clicking upload or when the node is saved. This leads me to believe that the description isn't saving. Additionally, the description in the content_type_* database table is empty too...
a:5:{s:3:"fid";s:2:"30";s:5:"width";i:270;s:6:"height";i:200;s:8:"duration";d:1.4285714285714286031492292750044725835323333740234375;s:11:"description";s:0:"";}

With FF Meta disabled:
On the edit page, the description field displays normally upon clicking Upload and it is saved in the database...
a:2:{s:11:"description";s:4:"test";s:7:"process";b:1;}

So the big question is, why isn't the description saving when Filefield Meta is enabled?

Thanks.

gabidrg’s picture

Managed to display file description like this:
- I have a filefield called field_prod_sheet, used to upload PDF files
- I had enabled description field, I have Meta turned off
- I used Contemplate to define a content template for Products nodes
- In Product contemplate I used:

print l($node->field_prod_sheet[0]['data']['description'], $node->field_prod_sheet[0]['filepath']);

Result is description linking to PDF file.

For some reason, $node->field_prod_sheet[0]['data']['description'] is not displayed in Contemplate variables list.

kirkade’s picture

Same problem, I need meta data and also the description field...

I don't find where the description is erase, really strange !

Matt Townsend’s picture

The suggestion in #21 is inadequate, as it doesn't use any logic to determine if a description exists. The patch provided seems fine for this. I'm not a programmer, but I put together my own little fix:

function theme_filefield_file($file) {
  $path = $file['filepath'];
  $url = file_create_url($path);
  $icon = theme('filefield_icon', $file);
  $desc = $file['data']['description'];
 if (empty($desc))
  {
  return '<div class="filefield-file clear-block">'. $icon . l($file['filename'], $url) .'</div>';
  }
  else {
   return '<div class="filefield-file clear-block">'. $icon . l($desc, $url) . '</div>';
  }
}

An alternative solution would be to return them both, with something like this:

return '<div class="filefield-file clear-block">'. $icon . l($file['data']['description'], $url) . ' (' . l($file['filename'], $url) . ')' . '</div>';

kruser’s picture

Title: File description not displayed with enabled » Filefield Meta erasing file descriptions
Priority: Normal » Critical
Status: Needs work » Active

The patches and fixes I'm seeing are purely for visual purposes - I'm seeing a more serious data issue here which is enabling the Filefield Meta is erasing the filefield descriptions without warning. See example data in #22.

EDIT: Filefield Meta isn't erasing immediately, only when you re-save the node.

Since Filefield Meta is erasing data and rendering the description field useless, I'm upgrading this to Critical.

Best case scenario would be for Filefield Meta to leave the description data intact and editable.

RobLoach’s picture

Version: 6.x-3.0-alpha5 » 6.x-3.x-dev

Hitting this in HEAD.

RobLoach’s picture

Status: Active » Needs review
FileSize
3.34 KB

Figured it out. I noticed that loading the $file->data['width'] height and duration in filefield_meta module wasn't required because it was already saved in the files data column already. Removing the load function worked. It then occurred to me that the filefield_meta table wasn't required at all since the ID3 information is already saved for us, and is automatically loaded.... The attached patch allows you to retain the description, alt and title fields throughout loading and saving the nodes.

RobLoach’s picture

FileSize
3.71 KB

This includes the update to remove the unneeded table.

RobLoach’s picture

FileSize
1.21 KB

Drewish recommended keeping the table.

kruser’s picture

You're the man! The patch worked well for me. Thanks a lot.

RobLoach’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for testing!

gnat’s picture

Patch works fine against the Dec 18 dev version. Thanks!

Screenack’s picture

Am I correct that the patch fixes the filefield meta problem, but not the issue regarding the printing of description data if present? Or is that now for a new issue?

RobLoach’s picture

Printing the data in the description is kind of out of context for this issue. If we were to output that data to the user, we would likely want another patch. Remember that we don't want to kill baby kittens.

On another note, who has commit access in this module and why isn't this in yet?

drewish’s picture

Status: Reviewed & tested by the community » Needs work

Sorry to take so long to review this but I still don't think this is right. I like the behavior of loading the metadata from the table, and if there's not a record we should generate one. We need to figure out where the non-filefield_meta data is being over written and fix just that bit.

dboune’s picture

While debugging this issue, looking only at the edit node process..

Case:
node with a single file attachment.
Saved with description while filefield_meta is disabled.
Returning to node edit shows previously saved description

Turn filefield_meta back on
Description no longer shows in the node edit.

In filefield_widget.inc : filefield_widget_value
When the 'file' and 'item' array variables are passed to array_merge, we loose the description field data stored in the 'item' variables 'data' element, and end up with only the 'data' element from the 'file' variable which only includes the information gathered by the filefield_meta module.
Unfortunately array_merge doesn't handle recursive merge, and only the last non-unique keys value survives. array_merge_recursive also falls down in this case, duplicating some elements.

igorik’s picture

subscribing, same problem (description fields on multiple image field disapeeard) on zen_classc sub-theme
Igorik

ragavendra_bn’s picture

Database not loosing value after 310126_1.patch on filefield-6.x-3.0-alpha5. The Alt, Description and Title not visible at all

Same results, database not loosing values after using either 310126_0.patch or 310126_1.patch or 310126.patch on filefield-6.x-3.x-dev. The Alt, Description and Title not visible at all.

RobLoach’s picture

The patch at #30 doesn't show the alt, description and title fields. It just makes sure they're loaded properly from the data column.

drewish’s picture

Status: Needs work » Fixed

i went a head and committed #30 so that i could do a new alpha release. i want to revisit this module but i'm not going to let this block a (more) stable release.

ragavendra_bn’s picture

Thanks Rob and Drewish. I had to enable Image Widget to Thickbox2 or Lightbox2 to enable click on images. I guess this is not related to Filefield........................

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mstef’s picture

Status: Closed (fixed) » Active

18 or so months later...and this is still a bug...

What happened?

quicksketch’s picture

Status: Active » Closed (fixed)

This problem was fixed a long time ago but resurfaced in #841212: warning: array_merge() [function.array-merge]: Argument #1 is not an array in..../filefield_field.inc on line 292.. The problem came back in version 3.5 of FileField but was corrected in 3.7. Just update to the latest version of FileField. Please open a new issue if you're still experiencing this problem with the latest version.

mstef’s picture

Thanks