Loading...
 
Skip to main content

When changing article type (during submit/post/new article) the body field disappears

Status
Pending
Subject
When changing article type (during submit/post/new article) the body field disappears
Version
1.9.x
2.x
Category
  • Usability
Feature
Article
Resolution status
New
Submitted by
zorp
Rating
(0)
Description

(This bug has been tested and verified on clean installs of TW 1.10b1 , 1.9.11 and on opensourcecsm.com)

When someone starts to create a new article (submit/edit/new) and chooses a different article type from the menu "Type", the field "Body" disappears (even if the heading_only property of the field is NOT set).

The problem seems only to exist on clean installs with empty databases which fill up the default values with null instead of 'n' for the different type settings.

In turn, the conditional in the function chgArtType() in the file /lib/tiki-js.js does not do a proper checking of the null values creating a situation where it interprets that the heading_only property for all article types is active (or so I gather). Thus it disables the Body field every time regardless of what the property of the article type says.

Solution

A quick work-around:
-Go into /tiki-article_types.php as admin
-Make a change (any change) to a setting (any setting) and save your work
-Change back the setting you changed and save your work
This will force TW to fill in the DB with 'n' instead of NULLs and the javascript will do it's work as intended.

Coding solution that seems to work:
in the file /lib/tiki-js.js
in the function chgArtType()

replace
if (typePropertiesproperty == value) {

with
if (typePropertiesproperty == value || (value=='n' && typePropertiesproperty=='')) {

The later conditional checks for situations when the default value in the function is 'n' but is NULL in the database (i.e. the situation when you have a fresh install of TW)

Importance
5
Priority
25
Demonstrate Bug on Tiki 19+
Please demonstrate your bug on show2.tiki.org
Demonstrate Bug (older Tiki versions)
 Show.tiki.org is currently unavailable

Unable to connect to show.tikiwiki.org. Please let us know of the problem so that we can do something about it. Thanks.

Ticket ID
1785
Created
Tuesday 27 May, 2008 07:52:26 GMT-0000
by Unknown
LastModif
Tuesday 27 May, 2008 07:52:26 GMT-0000