Hello!

When using full html to write in the users guestbooks, the HTML tags are posted along with the contents of the message. :-)

Best regards,
Ao

Comments

eric_a’s picture

Currently, the fallback format will be used when displaying messages. The vanilla Plain Text - the default Drupal fallback format - happens to be a text format that escapes all HTML tags, so they will be visible instead of being effective.

Storing and using a text format for a message/ a comment (and the D6/D7 upgrade path) is on the todo list.

eric_a’s picture

Status: Active » Needs work
StatusFileSize
new4.36 KB

A completely untested starting point and no upgrade path whatsoever. If you've already installed 7.x-2x you'll have to fix the schema yourself or re-install.

eric_a’s picture

StatusFileSize
new4.37 KB
new1.04 KB

Fixed schema declaration...

eric_a’s picture

Status: Needs work » Needs review
StatusFileSize
new5.18 KB
new880 bytes

Added upgrade path.
Please test.

eric_a’s picture

Status: Needs review » Needs work

when creating a new comment the patch in #4 results in setting the old global text format, instead of the current user default. Most probably we can do better, so back to needs work.

eric_a’s picture

Status: Needs work » Needs review
StatusFileSize
new5.28 KB
new449 bytes

This one only sets the old global format on comments in the database if the comment is not the empty string.
Please test.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

This makes a lot of sense

sun’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/guestbook.install
@@ -72,5 +74,26 @@ function guestbook_update_6201() {
+function guestbook_update_7000() {
...
+  db_add_field('guestbook', 'message_format', array(
...
+    'initial' => $format_id,
...
+  db_add_field('guestbook', 'comment_format', array(

Why is there no initial value for 'comment_format'?

If that's not an oversight, then we might want to add a short inline comment explaining why.

eric_a’s picture

Why is there no initial value for 'comment_format'?

If that's not an oversight, then we might want to add a short inline comment explaining why.

I'll try to come up with a decent comment. In the meantime: do you think that apart from the upgrade path the code is ready to commit? Wouldn't it be a good idea to split this up in two parts, then? That would give your user base a nice dev release to work with.

sun’s picture

Title: HTML tags are included in the guestbook message » Implement explicit text format for messages and comments
Category: bug » task
Status: Needs review » Fixed

I think I get it now; somehow didn't look at the following db_update().

Thanks for reporting, reviewing, and testing! Committed to 7.x-2.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.