13.x: Forum Thread Rating doesn't display icons for value 0, wrong icon for value 1, and no icons when labels are set beyond values
- Status
- Closed
- Subject
- 13.x: Forum Thread Rating doesn't display icons for value 0, wrong icon for value 1, and no icons when labels are set beyond values
- Version
- 13.x
- Category
- Error
- Usability
- Feature
- All / Undefined
Deliberation
Edit interface (UI)
Forum
Rating - Resolution status
- Fixed or Solved
- Submitted by
- Xavier de Pedro
- Lastmod by
- Xavier de Pedro
- Rating
- Description
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=1admin:
u: admin
p: 12345Log 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:Copy to clipboard0=foo,1=bar,2=bar2,3=bar3,4=bar4,5=bar5- Solution
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!
- Workaround
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.
Copy to clipboardforeach ($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.
- Importance
- 5
- Easy to solve?
- 5
- Priority
- 25
- 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
- 5257
- Created
- Wednesday 28 May, 2014 09:56:29 UTC
by Xavier de Pedro - LastModif
- Thursday 19 June, 2014 16:49:17 UTC