Jump to content

custom fields filled with carriage return


Recommended Posts

I defined a custom text field at a product, to enter by ordering.

This field can can contain more than one line, seperated by carriage returns.

This works fine by filling in, but after saving the carriage returns seemed to be lost.

Is this a bug or a strange behaviour?

Who can help me?

 

 

Link to comment
Share on other sites

I defined a custom text field at a product, to enter by ordering.

This field can can contain more than one line, seperated by carriage returns.

This works fine by filling in, but after saving the carriage returns seemed to be lost.

Is this a bug or a strange behaviour?

Who can help me?

 

This is not a bug but possibly a strange behavior.

 

controllers/front/ProductController.php

 

you will find code that replaces the <br /> with "\n"

foreach ($texts as $text_field)
	$text_fields['textFields_'.$this->product->id.'_'.$text_field['index']] = str_replace('<br />', "\n", $text_field['value']);

you can remove this at your own risk.  I do not know exactly why this is done.

Link to comment
Share on other sites

This is not a bug but possibly a strange behavior.

 

controllers/front/ProductController.php

 

you will find code that replaces the <br /> with "\n"

foreach ($texts as $text_field)
	$text_fields['textFields_'.$this->product->id.'_'.$text_field['index']] = str_replace('<br />', "\n", $text_field['value']);

you can remove this at your own risk.  I do not know exactly why this is done.

 

I deleted this part, but resulting in not saving custom field anymore, very strange!

Link to comment
Share on other sites

×
×
  • Create New...