What does this extension do?
This extension overrides the custom field’s “Show this field by default?” setting.
This version (1.1) works with Mark Huot’s custom field extensions, except for the Geo extension. (I might add that later but I never really got that extension to work yet)
EDIT: updated to version 1.1.1
Hi Cocoaholic,
Auto Collapse Empty Custom Fields extension if used together with Required Category extension causes a javascript error.
To replicate this error you these steps are needed: 1) install Required category extension 2) set categories to be required for one particular weblog 3) try to post an entry to that weblog without assigning to a category.
Firebug shows this error
el_name has no properties
if (el_name.substring(0,8)=='field_id') {
It is the line from the script which Auto Collapse Empty Custom Fields extension injects:
<code>//<![CDATA[ form_elements = document.getElementById('entryform').elements; var id_arr = new Array(); for(i=0; i<form_elements.length; i++) { el = form_elements; el_name = el.name; toggle = 0; if (el_name.substring(0,8)=='field_id') {</code>
Hi Laisvunas,
The problem seems to be a combination of both extensions and Firefox!
1 - The Required Category extension shows the Error message using a <fieldset> tag (standard EE behaviour) 2 - The Auto Collapse extension loops through all form elements to fetch the name of each element (the fieldset doesn’t have one) 3 - Firefox treats a fieldset as a form element (which I am not sure it actually is). Safari for instance does not do this and works fine.
If you are on a Windows machine, could you quickly test if this also happens in IE?
I’m looking into a way to prevent the behaviour you are seeing.
Ok, I found a workaround here and updated the extension to version 1.1.1
Please download again and let me know if this works for you.
Hi Elwin,
Just downloaded and installed updated version of Auto Collapse Empty Custom Fields extension, but Firebug still shows exactly the same error.
I have also checked with IE on Windows - also the same error.
P.S. Updated extension’s version number still is 1.1 build 20070108, so I’m not very sure I really tested updated version.
is there any way to get this to work just on the Edit screen, and not the Publish one?
Sure Nathan, I don’t have time to make that a setting right now, but here is a quick version that does what you want.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.