View Issue Details

IDProjectCategoryView StatusLast Update
0012683mantisbthtmlpublic2011-08-05 02:36
Reportermbtuser11 Assigned Toatrol  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version1.2.4 
Summary0012683: Newlines (\r\n) not being displayed in Mantis 1.2.4 bug view
Description

This may be happening on my server only. I have setup Mantis 1.2.4 on a RHEL5/CentOS system and when creating a bug I'm able to enter newlines in the description box without problems. When displaying it however, the newlines are not retained. In the MySQL db, they are present as \r\n

How can I get Mantis to display these newlines correctly?

For example, this:
"New sample bug

with new lines above

and here as well"

Shows up as:
"New sample bug with new lines above and here as well"

TagsNo tags attached.

Activities

atrol

atrol

2011-01-13 02:39

developer   ~0027917

Do you get the newlines from this issue?

mbtuser11

mbtuser11

2011-01-13 03:43

reporter   ~0027918

Hi atrol - Were you pointing to another bug because I can't see it in your note.

atrol

atrol

2011-01-13 03:51

developer   ~0027919

I am talking about the newlines you entered in the description of this issue.
You wrote: "I'm able to enter newlines in the description box ....."
Do you mean the newlines entered in notes or newlines entered in the description box?

mbtuser11

mbtuser11

2011-01-13 05:03

reporter   ~0027920

Both newlines in the description box and notes are being "lost" when displaying. Is there something specific I have to do with respect to PHP settings and/or something at the Mantis-level configuration for it to display properly?

atrol

atrol

2011-01-13 05:13

developer   ~0027921

I have to ask again:
Do you see the newlines of this issue 0012683 ?
I want to be sure whether the issue is caused by a server or a client setting

mbtuser11

mbtuser11

2011-01-13 05:40

reporter   ~0027922

Hi - sorry, I didnt understand what you meant earlier.

I have no problems seeing the newlines in "THIS" bug (0012683), only all the bugs on my Mantis setup.

atrol

atrol

2011-01-13 05:51

developer   ~0027923

I am not able to reproduce the issue in my test installations.

Did you install any plugin?
Did you write any custom functions?
Did you change the source code of MantisBT?

mbtuser11

mbtuser11

2011-01-13 06:40

reporter   ~0027925

No.
No.
No.

I did import a database from an older Mantis version into a newer / more recent one - that's it.

I understand that others and you won't be facing this problem and that's fine. There is distinctly something in my Mantis or server setup which is causing this.

Can you help me identify what PHP settings might be affecting this?

atrol

atrol

2011-01-13 06:46

developer   ~0027926

Do you get the problem only when looking at your old imported issues or also when entering new issues?

mbtuser11

mbtuser11

2011-01-13 07:22

reporter   ~0027927

Thanks for the continued follow-up atrol... I'm seeing the same issue for the imported as well as the newly created ones.

atrol

atrol

2011-01-13 08:36

developer   ~0027928

create a file test.php in root directory of your MantisBT installation with the following content


<?php
echo nl2br ("1\r\n2");
?>

Run the script
Do you get 1 or 2 lines output?

mbtuser11

mbtuser11

2011-01-13 12:58

reporter   ~0027929

Thanks atrol - I get them on different lines when its at www.mysite.com as well as when its at www.mysite.com/mantis/

mbtuser11

mbtuser11

2011-01-14 02:20

reporter   ~0027932

In php.ini, I changed
default_charset = "iso-8859-1"
to:
default_charset = "UTF-8"

But that did not work.

atrol

atrol

2011-01-14 03:06

developer   ~0027934

ATM I have no idea what's happening.
Maybe running admin/check.php will show bad settings of your installation.

mbtuser11

mbtuser11

2011-01-14 05:15

reporter   ~0027935

I was getting two errors because one of the tables, mantis_project_category_table was in CHARSET=latin1 format, whereas the rest of them are in utf-8

I deleted this table as it didnt seem to exist in the default setup of Mantis 1.2.4 - this led to the two errors being resolved, but didnt solve my newlines problem.

atrol

atrol

2011-01-14 05:57

developer   ~0027936

Seems that your current installation is not standard.
You should setup a complete new test installtion in a new directory and a new database and check if the issue exists.
I want to be sure not to waste time for debugging/trying and maybe finally finding that the issue is caused by a manipulated database and / or source

mbtuser11

mbtuser11

2011-01-14 06:18

reporter   ~0027937

The installation of Mantis 1.2.4 is standard. However, when importing the old content, I did the following relevant steps:

  1. I cleared ALL the tables completely. I did NOT drop them, just deleted all the rows.
  2. Then I imported the tables from the old Mantis version. There were a few fields mismatch for which I deleted them from the DATA, not the DB structure.

Because I was using mysql < file.sql format to import data, a new table would have been created which existed in the old Mantis setup but not in the new (1.2.4).

atrol

atrol

2011-01-14 07:10

developer   ~0027938

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.

mbtuser11

mbtuser11

2011-01-14 22:01

reporter   ~0027946

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');

atrol

atrol

2011-01-15 09:12

developer   ~0027954

Reminder sent to: dhx

David, do you think that your new checking system in version 1.3 should also check that MantisCoreFormatting plugin is active?

dhx

dhx

2011-01-15 09:20

reporter   ~0027956

I'm keen on removing MantisCoreFormatting completely (or at least removing the part where it escapes HTML). If we do end up keeping it then I do agree that we should have checks in place to ensure it is loaded.