Greetings,

I'm a total Drup Noob. I have a new install (5.6) on my local window box trying to go thru the Getting Started doc. All is well until I try to add an embedded image to content but it keeps getting filtered out when I view it live. When I view the source of the live page I do not see the <img..> tag info. I'm thinking it's getting filtered out since the <img> tag is not one of the defaults. So I figured, let's add it to the list of allowable tags.

When I try to add <img> html tag at the the Home>administrator>Site configuration>Input formats page under "Allowed HTML tags" and the then save configuration, it gets removed from the list.

Ok Uncle; I give. What's the skivvy here? Can someone help me out? I must be missing something silly.

Comments

gpk’s picture

Unfortunately Drupal 5.6 introduced a new bug (actually it was part of another bug fix that didn't quite work) that IMO should have been corrected over a week ago, but we are still waiting ...!!

The details are here http://drupal.org/node/208700.

There is a "patch" to fix it at reply #7 here http://drupal.org/node/208700#comment-688112.

You modestly say you are a Noob, so may I presume that you might not be wholly familiar with the application of patches? :-P In which case, make a backup of modules/filter/filter.module, and then in function filter_admin_configure() replace these lines (607-8 I think):

    $form['format'] = array('#type' => 'hidden', '#value' => $format->format);
    $form['#submit'][] = 'filter_admin_configure_submit';

with

    $form['format'] = array('#type' => 'hidden', '#value' => $format);
    $form['#submit']['filter_admin_configure_submit'] = array();

Also in function filter_admin_configure_submit() add

  system_settings_form_submit($form_id, $form_values);

as the first line of the function (after the function declaration in line 620 I think it is).

HTH

gpk
----
www.alexoria.co.uk

BlueMule’s picture

Spot-on gpk! You are right on the money. Also thanks for breakin' down the patch as your presumption is also correct.

Thanks.

gpk’s picture

Glad it's working now.

gpk
----
www.alexoria.co.uk

freixas’s picture

I must be living in an alternate universe.

When I look at the patch file, the line

system_settings_form_submit($form_id, $form_values);

is present. When I look at the drupal-5.x-dev download or even look at the latest CVS for the filter.module for Drupal 5, this line is not present.

With or without this line, the filter still does not work. The modified values I enter are placed in the variable table under the name "filter_html". In the variable table, my modification looks like this:

a:4:{s:13:"filter_html_3";s:1:"1";s:14:"allowed_html_3";s:3:"<a>";s:18:"filter_html_help_3";i:1;s:22:"filter_html_nofollow_3";i:0;}

The allowed HTML is obtained by a call to variable_get("allowed_HTML_$format", "...'). I don't see how the value "allowed_HTML_$format" gets into the $conf variable, which is where variable_get() gets its values. I can find it as

variable_get("filter_html")->allowed_html_3

A dump of the $conf variable just after an access to variable_get("allowed_HTML_$format") shows that $conf['allowed_html_3'] does not exist while $conf['filter_html']->allowed_html_3'] does exist.

Since the fixes seem to work for everyone else, I can only assume I have fallen into a parallel universe. Any suggestions from the real universe are welcome.

--
Tony Freixas
http://www.tigerheron.com/

tobiasr’s picture

I must be in that universe too because I have exactly the same problem on 5.10.

stuhannaford’s picture

hi, i'm a complete noob on drupal and have come across a problem with adding different tags into pages etc. i've made the changes as above and i can now add any tags into the allowed list. but when i went to add a standard table, the blocks on the right (i'm guessing left would also but i haven't got any enabled) all get pushed out of sync and end up in the footer in the centre of the page and the table i created will begin at the very bottom under this.

can anyone suggest any ideas?

please.....

ps i'm using drupal 5.6

gpk’s picture

Sounds like the content in the table cells is making the table exceed your theme's page width. Try setting a width for your table and/or table columns, in CSS, or using the width attribute.

gpk
----
www.alexoria.co.uk

stuhannaford’s picture

tried using the width attribute and it still did the same :( i then put a border line around the table to see how far it stretches to the sides to see if it exceeded the width and it all looks like it is well within the dimensions of the content section on screen and isnt overlapping the right hand blocks area. just to note i havent made any changes to the theme and am still using just the standard layout.

on the input formats i have created a new input format, exactly the same as filtered html, but have added img table td tr and have added php evaluator too. Used this format when trying to implement the table option. when i have used filtered html as the input everything lays itself out correctly, just without the table tags kicking in and creating the table properly.

im sure im being a complete numpty here but am soooooo stuck. if im being too vague just shout at me :D

thanks

ps forgot to say just to add a little more confusion to the story, it did work the first time i inputted a table this way but since the very first time it keeps shifting everything around

gpk’s picture

Suggest you maybe open a new topic rather than diverting this one ;-) and maybe post a link to the problem page in question so that someone can have a look at your HTML/CSS and find the problem.

HTH

gpk
----
www.alexoria.co.uk

stuhannaford’s picture

duplicated the above comment by accident sorry....

steve02476’s picture

I'm a brand new Drupal 5.6 user and ran into the 'can't change filter bug'. I was nervous about patching my system, but these instructions http://drupal.org/node/212338#comment-698979 worked fine for me. Thanks.

gpk’s picture

Also, here are some options for anyone who feels like neither patching nor editing their filter.module:

  1. use the filter.module from the development snapshot of Drupal 5.x http://drupal.org/drupal-5.x-dev, which already includes the fixed version of filter.module, Revision 1.160.2.6. It is conceivable that filter.module in 5.x-dev will change again due to another bug fix and (possible, but fairly unlikely) become incompatible with the rest of 5.6. However, as long as Revision 1.160.2.6 is listed at the top of this page http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/filter/filter.modu..., you know you are safe :-)
  2. You could even use the whole of 5.x-dev instead of 5.6 as your codebase.
  3. You can even get Revision 1.160.2.6 of filter.module directly from the page linked above (note that once downloaded the version seems to come out as Revision 1.160.2.5 for some reason).
  4. or just wait for 5.7 :-P

Take your pick!

gpk
----
www.alexoria.co.uk