Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003888TestLinkInventory / Platformspublic2010-10-12 15:252010-11-14 12:07
ReporterWertenbruch 
Assigned Tofman 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindows OSXPOS VersionSP/SP3
Product Version1.9 RC 1 
Fixed in Version1.9 (Prague) 
Summary0003888: Inventory fields are erased if any line break is entered (MySQL)
DescriptionIf a Inventory is created or edited and in one of the fields "Zweck", Hardware" or "Notizen", a line break was entered, the whole content of all three fields are erased.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySql
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Filesjpg file icon Inventar.JPG [^] (67,976 bytes) 2010-10-12 15:25


jpg file icon a.jpg [^] (25,709 bytes) 2010-10-12 18:32


jpg file icon b.jpg [^] (23,916 bytes) 2010-10-12 18:32


jpg file icon 1.JPG [^] (42,179 bytes) 2010-10-13 06:52


jpg file icon 2.JPG [^] (58,431 bytes) 2010-10-13 06:53


jpg file icon 3.JPG [^] (54,272 bytes) 2010-10-13 06:53


zip file icon fix-3888.zip [^] (4,047 bytes) 2010-10-17 08:43

- Relationships

-  Notes
(0011871)
fman (administrator)
2010-10-12 18:30

Unable to reproduce

Browser: Firefox
DB: Postgres

1. create a new inventory
2. Purpose: line1 [ENTER] line2 [ENTER] line3
3. Hardware: line1[ENTER][ENTER]line2
4. same on notes
5. save
6. edit
7. contents is what has been filled when created
8. add a couple of [ENTER]
9. save
10. all works OK
(0011872)
Wertenbruch (reporter)
2010-10-13 06:52

But I'm able to reproduce it every time on our system.
Browser: IE 8, Firefox 3.6.10

Server: MySQL 5.1, PHP 5.2.14, Apache HTTP Server 2.2.16, Windows XP/SP3

Please see attached screenshots.
(0011873)
fman (administrator)
2010-10-13 07:53

Reminder sent to: Julian

would you mind to do a test ?
(0011874)
Julian (reporter)
2010-10-13 08:02

i can reproduce -> test on our testlink installation
(0011931)
fman (administrator)
2010-10-16 16:41

Verified that this happens when DB is MySQL, with Postgres works OK.
(0011932)
fman (administrator)
2010-10-16 17:07
edited on: 2010-10-16 17:25

May be part of reason is
http://stackoverflow.com/questions/2853454/php-unserialize-fails-with-non-encoded-characters [^]

http://bytes.com/topic/php/answers/1828-unserialize-arrays-newlines-error [^]

http://www.backwardcompatible.net/php-unserialize-bug-and-codeigniter [^]

------------------------------------------------------------------------------
On PHP manual notes (an old one):
pfister at avenir dot de
02-Sep-2004 09:25
Having had a problem with an mysql-stored serialized array which I had edited I found out that unserialize seems to have got a problem with "\r" within the string I wanted to unserialize.
------------------------------------------------------------------------------

http://stackoverflow.com/questions/3688442/unserialize-function-does-not-work-on-a-variable-from-the-mysql-table-on-new-se [^]

(0011933)
fman (administrator)
2010-10-17 08:28

Found!:
Issue is created by this:

$this->inventoryContent['hardware'] = $db->prepare_string($this->inventoryContent['hardware']);
$this->inventoryContent['notes'] = $db->prepare_string($this->inventoryContent['notes']);
$this->inventoryContent['purpose'] = $db->prepare_string($this->inventoryContent['purpose']);
$data_serialized = serialize($this->inventoryContent);

and depends on each DBMS (MySQL, Postgres, MSSQL, etc), regarding what DBMS
consider an special string and how has to be escaped.
May be this time MySQL has helped to found a conceptual error.

Replacing the lines detailed above with just :
$data_serialized = $db->prepare_string(serialize($this->inventoryContent));
all works OK on MySQL and Postgres.

use attached file, retest and let us know.
(0012040)
fman (administrator)
2010-10-22 18:52

any feedback ?
(0012538)
fman (administrator)
2010-11-14 12:07

1.9 (Prague) Released

- Issue History
Date Modified Username Field Change
2010-10-12 15:25 Wertenbruch New Issue
2010-10-12 15:25 Wertenbruch File Added: Inventar.JPG
2010-10-12 18:30 fman Note Added: 0011871
2010-10-12 18:32 fman File Added: a.jpg
2010-10-12 18:32 fman File Added: b.jpg
2010-10-12 18:33 fman Assigned To => fman
2010-10-12 18:33 fman Status new => feedback
2010-10-13 06:52 Wertenbruch Note Added: 0011872
2010-10-13 06:52 Wertenbruch Status feedback => assigned
2010-10-13 06:52 Wertenbruch File Added: 1.JPG
2010-10-13 06:53 Wertenbruch File Added: 2.JPG
2010-10-13 06:53 Wertenbruch File Added: 3.JPG
2010-10-13 07:53 fman Note Added: 0011873
2010-10-13 08:02 Julian Note Added: 0011874
2010-10-16 16:41 fman Note Added: 0011931
2010-10-16 17:07 fman Note Added: 0011932
2010-10-16 17:16 fman Note Edited: 0011932 View Revisions
2010-10-16 17:19 fman Note Edited: 0011932 View Revisions
2010-10-16 17:22 fman Note Edited: 0011932 View Revisions
2010-10-16 17:25 fman Note Edited: 0011932 View Revisions
2010-10-17 08:28 fman Note Added: 0011933
2010-10-17 08:32 fman Summary Inventory fields are erased if any line break is entered => Inventory fields are erased if any line break is entered (MySQL)
2010-10-17 08:34 fman Status assigned => feedback
2010-10-17 08:43 fman File Added: fix-3888.zip
2010-10-22 18:52 fman Note Added: 0012040
2010-10-25 19:12 fman Status feedback => resolved
2010-10-25 19:12 fman Fixed in Version => 1.9 (Prague)
2010-10-25 19:12 fman Resolution open => fixed
2010-11-14 12:07 fman Note Added: 0012538
2010-11-14 12:07 fman Status resolved => closed



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker