Loading...
 
Skip to main content

Not possible to use 0 as the value for an option of the dropdown tracker field

Status
Closed
Subject
Not possible to use 0 as the value for an option of the dropdown tracker field
Version
18.x
18.x Regression
Category
  • Error
  • Regression
Feature
Trackers
Resolution status
Fixed or Solved
Submitted by
Bernard Sfez / Tiki Specialist
Volunteered to solve
Roberto Kirschbaum, Jonny Bradley
Lastmod by
Bernard Sfez / Tiki Specialist
Rating
(0)
Description

On Tiki 18.x I have a tracker with a dropdown field to display different values.

By default the value should be 0.
The dropdown doesn’t display an option if the value of the option is 0.

I tried:
0,1,2,3,4,5

0=0,1=1,2=2,3=3,4=4,5=5

0=0,0=0,1=1,2=2,3=3,4=4,5=5

=0,=0,1=1,2=2,3=3,4=4,5=5

0=None,0=None,1=1,2=2,3=3,4=4,5=5

None are working (none=None,none=None,1=1,2=2,3=3,4=4,5=5 is working fine)



I created an instance.
The field time is a dropdown with the following options: 0=0 hours,1=1 hour,2=2 hours,3=3 hours,4=4 hours

Go at: http://bsfez-11581-6744.show.tikiwiki.org/tiki-view_tracker.php?trackerId=1
Create an item, the first value (equal 0) is not displayed.

I have the feeling this is a nasty regression.(in another case changing back the value for something else than 0 didn’t make the "lost" options reaper.

Solution

Smarty thought that 0 is equal to other{/tr}
We had to make smarty template explicitly treat $value !== 0

Fixed in Master/Trunk/23.x:
https://gitlab.com/tikiwiki/tiki/-/commit/d703343ffb908e7c19d59fe8474903fdf2b45103

To be backported soon

Importance
6
Easy to solve?
7
Priority
42
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
6744
Created
Tuesday 07 August, 2018 08:02:56 UTC
by Bernard Sfez / Tiki Specialist
LastModif
Wednesday 07 December, 2022 11:51:14 UTC


Show PHP error messages