add support for CCK text fields

jruz - September 25, 2008 - 21:47
Project:Filter Default
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

:(

#1

chellman - September 25, 2008 - 22:25
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

What aspect isn't working for you? A sad emoticon does not a bug report make.

It works just fine here.

#2

jruz - September 27, 2008 - 16:25

sorry,

i have it installed in 3 diferent 6.4 installations y set the default values for every role (editor, admin) but is still is showing the defult input filter selected on every cck field (comments).

im now testing if it has something to do with cck or with self created input filters.

thanks for your time

#3

chellman - September 27, 2008 - 18:54
Category:bug report» feature request

Ah ha, now that's information I can use. Thank you for following up.

I just tested this, and can confirm that this doesn't work with CCK fields, only the body field. I'm changing this to a feature request. It's worth looking into.

#4

grendzy - October 1, 2008 - 18:29
Status:postponed (maintainer needs more info)» needs review

Here's a patch:

AttachmentSize
filter_default_cck_patch.txt 1.09 KB

#5

grendzy - October 1, 2008 - 18:33
Title:not working on 6.4» add support for CCK text fields

#6

jruz - October 6, 2008 - 16:25

works perfect!!!

thanks!

#7

moshe weitzman - November 19, 2008 - 20:11

Seems like this module could recurse through all of $form and change anything that looks like a format field. That would catch excerpt module and many others.

#8

moshe weitzman - November 20, 2008 - 17:32

Here is some code from mollom module that scans for any button on the form. The code needed for filter is similar

<?php
foreach (element_children($form) as $key) {
     
// Iterate over the form elements looking for buttons:
     
if (isset($form[$key]['#type']) && ($form[$key]['#type'] == 'submit' || $form[$key]['#type'] == 'button')) {
       
// do stuff
     
}
    }
?>

#9

chellman - November 20, 2008 - 17:44

Thanks, Moshe. I like this idea, and assuming no one else beats me to it, I'll take care of it soon. This is much more appealing than checking for each individual thing explicitly.

#10

grendzy - November 25, 2008 - 00:02

I agree a module-agnostic approach would be best. I'm having trouble finding the correct fieldset, though, using this approach.

Actually my patch in #4 is giving me trouble on one site. I'm not sure why, but I needed to remove this conditional:

<?php
if (isset($form[$field->field_name][$element]['#default_value']['format'])) {
?>

 
 

Drupal is a registered trademark of Dries Buytaert.