0

I've exported a Mantis project from one server to another and despite the MySQL SQL file (from which it was populated) showing:

(15375,'\r\n1. Log out\r\n\r\n2. When logging in, start ...

The final end-user view loses the \r\n and shows it only on one line:

1. Log out 2. When logging in, start typing 

When viewing through phpMyAdmin, I can see the record properly:

1. Log out

2. When logging in, start typing

How can I correct this behavior when displaying this data?

2 Answers 2

0

\r\n is not displayed in HTML as a new line so it must be replaced with <br /> (using the php function nl2br) or the text must be parsed into paragraphs (like wordpress does it).

I am not familiar with Mantis, but maybe there are some settings regarding the output of a text.

If you cannot find the place where to make the changes in Mantis code/settings then maybe a dirty hack would be to just replace it directly in the SQL file. But in this case, the <br /> tag would probably show up when you'll edit the text later.

1
  • i think there should be some server level setting or Mantis level setting that should be taking care of it... Introducing the <br> would be a very last choice for me.
    – siliconpi
    Jan 13, 2011 at 0:22
0

The problem was due to me incorrectly importing data from the old database.

http://www.mantisbt.org/bugs/view.php?id=12683

atrol (developer) 2011-01-14 07:10

read file doc/INSTALL chapter UPGRADING for the recommended way how to upgrade. I am quite sure that your step 1. is the reason for your problem.

You cleared table mantis_plugin_table, so you disabled the MantisCoreFormatting plugin which is the one who is reponsible for formatting the HTML output of issues. (where also handling of newlines is implemented)

Futhermore you cleared mantis_config_table. This is not a problem for the moment, but will be a problem in future for you when upgrading. There is one setting to hold the database schema version which is used when upgrading.


2011-01-14 22:01

Thanks atrol! That solved the problem exactly. I also restored / set mantis_config_table to its 1.2.4 value

INSERT INTO mantis_config_table VALUES ('database_version',0,0,90,1,'183');

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .