Calendar item start/end hour selection is broken in Tikiwiki 2.0 using PHP 4.3.2 or previous - Patch
- Status
- Pending
- Subject
- Calendar item start/end hour selection is broken in Tikiwiki 2.0 using PHP 4.3.2 or previous - Patch
- Version
- 2.x
- Category
- Patch
- Feature
- Calendar
- Submitted by
- sacra
- Lastmod by
- sacra
- Rating
- Description
On TikiWiki 2.0, when adding or editing events in a <span class= "highlight_word_0">calendar</span>, if you're using PHP 4.3.2 or previous, you will only be allowed to choose 0, 1 or 2 as the <span class= "highlight_word_1">start</span>/<span class= "highlight_word_2">end</span> hour, even if the <span class= "highlight_word_0">calendar</span> is configured to offer 0-23 or something along those lines.
This is because of the following line in the file $TW_HOME/lib/smarty_tiki/function.html_select_time.php:
Copy to clipboard$hours = $use_24_hours ? range($hour_min, $hour_max) : range(1, 12);
The range function, as explained here (see ChangeLog), in PHP versions previous to 4.3.2 inclusive, treats numeric strings as strings and not integers which <span class= "highlight_word_2">end</span>s up meaning that "23" is seen as "2", hence producing the problem.- Files
- Solution
For example, replace the line by:
Copy to clipboard$hours = $use_24_hours ? range((int)$hour_min, (int)$hour_max) : range(1, 12);- Importance
- 3
- Priority
- 15
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 1993
- Created
- Thursday 28 August, 2008 13:13:32 UTC
by Unknown - LastModif
- Saturday 06 July, 2024 10:21:44 UTC