Is possible assign html text format to the order's comments?

If the admin add a comment with multiple lines after update show a continued plain text, even if in the html code is like would be.

For example a comment must be:

line1
line2
line3

but is displayed in this way:

line1 line2 line3

Comments

RAFA3L’s picture

Changing this in uc_op_order_comments_view_table now recognise the breaklines

$data['comment'] = array(
'#markup' => check_plain($comment->message),
'#cell_attributes' => array('class' => 'message'),
);

to

$data['comment'] = array(
'#markup' => check_markup($comment->message),
'#cell_attributes' => array('class' => 'message'),
);

Now, one step more, how to use CKEditor? I can display de editor changing this...

$form['order_comment_field']['order_comment'] = array(
//'#type' => 'textarea',
'#type' => 'text_format',
'#description' => t('Order comments are used primarily to communicate with the customer.'),
);

But when save the comment I get this error...

PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO {uc_order_comments} (order_id, uid, message, order_status, notified, created) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2_value, :db_insert_placeholder_2_format, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 56 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_3] => pending [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 1369235112 [:db_insert_placeholder_2_value] =>

ads asdads

[:db_insert_placeholder_2_format] => filtered_html ) in uc_order_comment_save() (line 1257 of /Applications/MAMP/htdocs/mysite/sites/all/modules/ubercart/uc_order/uc_order.module).

tr’s picture

Status: Active » Postponed (maintainer needs more info)

I don't really like the idea of using HTML in order comments - that assumes that the only purpose/use of the comment will be for display on the web. I'd much rather see a solution where the comment is run through a line break filter before being displayed. You don't say *where* you are seeing the issue of text wrapping...

tr’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

No further information provided.

acdtrp’s picture

Issue summary: View changes

I don't agree that it assumes that the only purpose/use of the comment will be for display on the web - what about e-mail services that are not sophisticated enough to convert hyperlinks? Most of our customers are using crappy Bulgarian web email provider which does (or rather say doesn't) exactly that and all of the links we send in order comment remain unclickable there. What is your solution for this problem?