SiT! Bugs

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001150SiT!knowledge basepublic2010-03-15 13:202010-03-27 12:30
Reporternicdev 
Assigned Tonicdev 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.51 
Target Version3.60 LTSFixed in Version3.60 LTS 
Summary0001150: When editing a KB article - The "Additional information" headers is duplicated instead of updated
DescriptionWhen editing a KB article, and you edit the "Additional information" field, a new entry is put into the database instead of updating the existing entry. If you have edited this 2 or 3 time then you have a KB with 3 x "additional informations"
TagsNo tags attached.
Attached Filesjpg file icon KBbug.jpg [^] (114,045 bytes) 2010-03-19 07:50

- Relationships
related to 0001156resolvedTomse KB Article headings need i18n 

-  Notes
User avatar (0002707)
nicdev (developer)
2010-03-15 14:14
edited on: 2010-03-15 14:16

I did some checking and i believe it has to do with the space in "Additional information" which is stripped. When we return without the space then we fail to get an id and that is when a new entry is written. We use the section name from the form as $sectionvar.

I am not sure how to fix this ... any ideas?

(0002726)
anonymous (viewer)
2010-03-18 09:44
edited on: 2010-03-18 09:44

Hi everyone, can anyone test this and see if it just on my side or really a bug?

User avatar (0002727)
Tomse (developer)
2010-03-18 15:58

I've tried editing the additional info a few times now.. No additional articles were created.

Can you tell what precise steps you do to add the article in the first place ?

I just added a new article, added name, question and answer.
and then later added the additional info a couple of times.

this is running the current SVN
User avatar (0002728)
nicdev (developer)
2010-03-19 07:49

Hi Tomse,

Thanks for testing. I running 3.51, as it is a production system. The steps are as follows:
1. Create A KB article with some "additional information" and save
2. Click Edit to edit the KB article, but don't change anything and immediately click Save again
3. The KB now shows with 2x the additional information field

OR
1. Create A KB article with some "additional information" and save
2. Click Edit to edit the KB article, and edit any field including the additional information field, click save
3. The KB now shows with 2x the additional information field

See the screenshot attached:
User avatar (0002729)
nicdev (developer)
2010-03-19 10:02

Hi All,

I have found the problem and the solution ;)

Looking at the code in kb_article.php:
[code]
146 $secobj = mysql_fetch_object($secresult);
147 if (!empty($secobj->content))
148 {
149 $sections[$section] = $secobj->content;
150 $sectionstore .= "<input type='hidden' name='".strtolower($section)."id' value='{$secobj->id}' />\n";
[/code]
We are adding "post" data but we are not removing the "space" from "additional information" before submitting it in line 150. Thus "Additional information" does not get an id posted:

i fixed the code by adding a replace statement which is done earlier in the code but was omitted here:
[code]
146 $secobj = mysql_fetch_object($secresult);
147 if (!empty($secobj->content))
148 {
149 $sections[$section] = $secobj->content;
150 $section = str_replace(" ", "", $section);
151 $sectionstore .= "<input type='hidden' name='".strtolower($section)."id' value='{$secobj->id}' />\n";
[/code]

Now it works fine.

Ivan can you confirm and then i can post the fiw to SVN?

thanks
User avatar (0002730)
ivan (administrator)
2010-03-19 10:21

After talking to Nicdev007 I can see there's a problem in the code here, we're using "Addition Information" (with a space) as an input field name, which obviously won't work well. Haven't actually tried to repro it, but I've no doubt it's a mistake.

For 4.x we should internationalise these heading and not use spaces in the section names at all, but for 3.x Nico's fix is best because it avoids adding strings and we're in string freeze.

Thanks Nico.
User avatar (0002731)
nicdev (developer)
2010-03-19 10:36

Temp fixed in Revision 6274 in SVN 3.x.

Note: We have to keep this open to remind ourselves to internationalise the headings for 4.x

Thanks for the moment Ivan, i know you are busy ;)

Just to note i backported this fix to the production 3.50 server and it solves the issue there as well.
User avatar (0002737)
ivan (administrator)
2010-03-20 10:26

The fix that nicdev has commited (r6274) works just fine for 3.x, but as he's said we need to a bit work on this for 4.x I'll open a new bug for that.

- Issue History
Date Modified Username Field Change
2010-03-15 13:20 nicdev New Issue
2010-03-15 14:14 nicdev Note Added: 0002707
2010-03-15 14:16 nicdev Note Edited: 0002707 View Revisions
2010-03-18 09:44 anonymous Note Added: 0002726
2010-03-18 09:44 anonymous Status new => feedback
2010-03-18 09:44 nicdev Note Edited: 0002726 View Revisions
2010-03-18 15:58 Tomse Note Added: 0002727
2010-03-19 07:49 nicdev Note Added: 0002728
2010-03-19 07:49 nicdev Status feedback => new
2010-03-19 07:50 nicdev File Added: KBbug.jpg
2010-03-19 10:02 nicdev Note Added: 0002729
2010-03-19 10:21 ivan Note Added: 0002730
2010-03-19 10:21 ivan Assigned To => ivan
2010-03-19 10:21 ivan Status new => confirmed
2010-03-19 10:36 nicdev Note Added: 0002731
2010-03-19 11:55 ivan Target Version => 3.60 LTS
2010-03-20 10:25 ivan Tag Attached: needsporting
2010-03-20 10:26 ivan Note Added: 0002737
2010-03-20 10:26 ivan Status confirmed => resolved
2010-03-20 10:26 ivan Fixed in Version => Current SVN
2010-03-20 10:26 ivan Resolution open => fixed
2010-03-20 10:26 ivan Assigned To ivan => nicdev
2010-03-20 10:34 ivan Relationship added related to 0001156
2010-03-23 21:19 ivan Tag Detached: needsporting
2010-03-27 11:16 ivan Fixed in Version Current SVN => 3.60 LTS
2010-03-27 12:30 ivan Status resolved => closed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker