Active
Project:
Comment Upload
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2009 at 20:23 UTC
Updated:
2 Jul 2011 at 20:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
heine commentedYou can write a module that implements a form_alter hook, and sets the collapsed property of the attachments field to false:
As it has to run after CU, give it a weight of 11 in the system table.
Comment #2
jrdixey commentedHi Heine,
That worked. Cheers!
Question: Is the little module I wrote based on your advice worth contributing? Might save someone some time if they don't know PHP. I'm sure it could use a lot more work (like making it optional based on the content type), which I don't know how to do yet, but I'm thinking if I were to contribute it, someone else might want to help expand on it. What do you think?
jrd
Comment #3
heine commentedNot really, and certainly not as an extra module vs. a patch against CU. The current behaviour is sane and applies to most situations.
Comment #4
jrdixey commentedThanks for the feedback -- I suspected as much. I'm just learning about how all this comes together so I appreciate your assistance.
I'm changing this to a minor feature request, so when/if there's a new maintainer they can pick it up if they're interested.
jrd
Comment #6
RikiB commentedI dont know php extremely well, could you give a little tutorial on how you did it? I would love to be able to do this, Im using the Drupal 6 version btw. Is there a way I can just patch the module itself?
Comment #7
jrdixey commentedHi Riki,
I would strongly advise you not to patch the module itself - you would only have to patch it again after the next module upgrade. I'll zip up the little module I wrote and drop it here as an attachment. It works in D6. That said, it really is only one line of code, so a module is overkill for this. I've been told I should have done it differently (see above) but it's working, so I'm keeping it for now. :)
Cheers
Jennifer
Comment #8
scarer commentedhere's a working little module if you need it. it's for drupal 6 :)
cheers,
sarah
Comment #9
volocuga commentedIt seems the latest release has attachment form expanded by default. I'd like to collapse it
I created a module that contains the following:
I can change everything, for example using
$form['attachments']['#description'] = 'Custom description';I can change a text inside the fieldset, BUT CAN NOT collapse the fieldset.
What am I doing wrong?
Thanks!
Comment #10
RikiB commentedIve been searching and have tried everything but cant have "File attachments" expanded by default on comments. Is there any way to do this?
Comment #11
geerlingguy commented@volocuga - you'll need to manually make sure your custom module's 'weight' in the system table (your database) is 'heavier' than the comment_upload module; that way your form alter will take precedence. I think this setting should be optional—I'd rather not have the file attachments form expanded by default, because I rarely need to use the comment upload form, but I'd still like it there...
So, the steps to fix this for your site:
1. Put the following into your site's custom.module (If your module is named something_else.module, replace 'custom' with 'something_else'):
2. In your {system} table (in your site's database), make sure the 'weight' value for your custom module is higher (a greater integer) than the comment_upload module (for example, if comment_upload's weight is 0, you can have your module's 'weight' be 1 or more, and that will take care of it).
That way, you can override the default behavior.
Comment #12
xaa commentedhello,
thanks geerlingguy. it works fine !
Could you tell me why if I try to add the function on the comment_upload module directly it doesn't work ??