notice: Undefined index: default_format in /home/.dez/xxx/xxx.com/drupal6/modules/filter/filter.module on line 498.

* What are the steps required to reproduce the bug?
Administer > Site configuration > Input formats
Changed default Input format from Filtered HTML to Full HTML.

* What behavior were you expecting?
Not to have this error pop up. I got the following confirmation:
-The input format settings have been updated.
But the warning followed afterwards..

* What happened instead?
Should change the input format without the notice warning.

Please include as much information as you can:
OS = Windows Vista Business Edition
webserver name and version = Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2
PHP version = PHP Version 4.4.7
Drupal version = 6.0-dev
Drupal path = admin/settings/filters
and everything else you might feel is relevant
-> MySQL: 5.0.24a
-> The default did change and save correctly.
-> Warning would not come back when changed between different filters.
-> Warning would come back when I add/remove roles from the filtered HTML filter.

Comments

webchick’s picture

Priority: Critical » Minor
Status: Active » Needs review
StatusFileSize
new1009 bytes

Wow, what a nice, thorough bug report! :D

I wasn't able to reproduce this notice on changing the default input format, but rather by clicking "configure" on the format which is NOT the default input format and saving the form. This patch seems to fix it.

Two things:
1) I downgraded this to 'minor' because a 'notice' (even though it looks scary) is just a minor error. warnings or errors are more severe, and warrant a higher status.
2) Unless you really, really, really know what you're doing, you should NEVER make Full HTML the default input format! Full HTML bypasses the various XSS and other security checking, and the default input format is usable by ALL roles, including anonymous users. This means that a malicious person could come along to your site, post a comment with some tricky JavaScript in it, and start stealing peoples' cookies and such. A much better approach is to configure the Filtered HTML input format to specifically include the tags you want people to post.

mlsamuelson’s picture

Appears to be a straightforward patch. It applied cleanly, and resolved the issue as described by webchick.

mlsamuelson

mlsamuelson’s picture

Status: Needs review » Reviewed & tested by the community

Appears to be a straightforward patch. It applied cleanly, and resolved the issue as described by webchick.

mlsamuelson

mlsamuelson’s picture

This appears to be a straightforward patch. It applied cleanly, and resolved the issue as described by webchick.

mlsamuelson

mlsamuelson’s picture

Sorry about the duplicate postings. The site kept giving me errors, so I'd go back, and submit again... my apologies.

mlsamuelson

dries’s picture

Status: Reviewed & tested by the community » Needs work

It's kind of a long line now. Would be nice to split that up a little, and to move the check to its own line/statement.

mlsamuelson’s picture

Status: Needs work » Needs review
StatusFileSize
new824 bytes

I've attached a new patch which moves the check to its own line by restructuring the code to use if/else syntax rather than ternary operator syntax.

Hope this is what you had in mind...

gábor hojtsy’s picture

Status: Needs review » Fixed

Looks good, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)