Hello,
Last version of CTools has changed the way field types are rendered, currently items which has no field items are excluded.
This is a problem with this module, because Fivestar shows the voting widget even when the field is empty (The entity has not been voted yet). In this way, the widget is never shown because it's not possible to vote.
To avoid this, I created a patch for this moduel to alter the way entity field panes are rendered when dealing with a fivestar field.
This patch requires the patch included in this issue: #2373297: hook_ctools_content_subtype_alter() does not provide any reliable way to identify the subtype being altered. I hope will be included in CTools soon.
Thanks!
Comments
Comment #2
plopescPatch attached
Comment #3
svarc commentedi can confirm that there is an issue and the fivestar widget is not shown in panel pages, however @plopesc the patch #2 you provided throws error:
"Notice: Undefined offset: 1 in fivestar_ctools_content_subtype_alter() (line 995 of /home/svarc/sites/funkidsgames/www/sites/all/modules/contrib/fivestar/fivestar.module)."
dpm($subtype_id) returns nothing...
i will investigate this further if i have time.
maybe its possible to bypass this if we add another widget type "Stars (rated while editing and viewing)" so the creator of the node can initially vote, but as i said it will be just bypass not a solution for the issue.
thanks @plopesc for sharing this with us.
Comment #4
capuleto commented@svarc.. applying the suggested patch to CTools fixes the notice you mentioned.
@plopesc I have updated the patch to fix another warning when the field storing the votes does not have any value.
Warning: array_slice() expects parameter 1 to be array, boolean given in fivestar_fivestar_field_content_type_render() (line 1055Comment #5
millionleaves commentedThanks for this patch.
I've applied the CTools patch and the Fivestar patch in #4 and my panels are displaying Fivestar panes again. No errors or issues encountered.
Comment #6
Adirael commentedApplying the provided patch and the related ctools patch worked for my case too.
Comment #7
jenlampton+1 on RTBC from me. thanks @capuleto!
Comment #8
capuleto commentedThis is a re-roll since: #2373297: hook_ctools_content_subtype_alter() does not provide any reliable way to identify the subtype being altered has already fixed without updating the signature of hook_ctools_content_subtype_alter.
Unfortunately the patch committed to CTools does not ensure that the subtype_id key is present, thus a new patch need to be applied to CTools #2829782: hook_ctools_content_subtype_alter() does not *always* provide reliable way to identify the subtype being altered in order to allow Fivestar to render voting widgets in panels pages
Comment #9
capuleto commentedComment #10
kevinsiji commentedTested. Working. Fivestar widget is now visible in node panel.
Comment #11
dbt102 commentedThanks for the patches and reviews getting ready to commit this...
Comment #13
dbt102 commentedComment #14
dbt102 commented