13.x: Forum Thread Rating doesn't display icons for value 0, wrong icon for value 1 (fixed) , and no icons when labels are set beyond values (unfixed still)
I have it reproduced reusing the show instance of this other bug report:
https://dev.tiki.org/item5253
(linked here in case I need to go there to "svn up" again)
See this thread started by admin:
http://xavi-9794-5253.show.tikiwiki.org/tiki-view_forum_thread.php?comments_parentId=1
admin:
u: admin
p: 12345
Log in as user1
u: user1
p: user1
And here you can see a screenshot of the issue reproduced similarly in local:
With these values in Wiki rating options:
0=foo,1=bar,2=bar2,3=bar3,4=bar4,5=bar5
Hi Gezza,
The issue is due to the foreach array value, Because there is no key is used to store the values in array and display it the option is directly used. Now i fixed it by giving key values.
Please refer the commit Id :51666
Thanks
Fix confirmed. Thanks!
note: mani is working on a fix
gezzaz note: I also took a look, maybe you find my findings useful. Problem seems to be with function get_options_smiles in lib/rating/ratinglib.php
When you set a name (text) for rating options, confusion comes as numbers are expected on some places.
foreach ($options as $key => &$option) { $optionsAsKeysSorted[$option] = $key; } unset($key); ksort($optionsAsKeysSorted); $sets = $this->get_options_smiles_id_sets(); $set = $sets[count($options)]; foreach ($optionsAsKeysSorted as $key => &$option) { $option = array( 'img' => 'img/rating_smiles/' . $option . '.png', 'color' => $colors[$option] ); }
this seems to work for me, but also in rating.tpl you need to change the key and value in the foreach when rating_smileys pref is on.
There might be some conceptual confusion here when having text as rating values, I could not get further yet.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |