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

plopesc created an issue. See original summary.

plopesc’s picture

Status: Active » Needs review
StatusFileSize
new2.97 KB

Patch attached

svarc’s picture

i 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.

capuleto’s picture

StatusFileSize
new3.03 KB
new511 bytes

@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 1055

millionleaves’s picture

Thanks 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.

Adirael’s picture

Status: Needs review » Reviewed & tested by the community

Applying the provided patch and the related ctools patch worked for my case too.

jenlampton’s picture

+1 on RTBC from me. thanks @capuleto!

capuleto’s picture

StatusFileSize
new848 bytes
new3.06 KB

This 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

capuleto’s picture

Status: Reviewed & tested by the community » Needs review
kevinsiji’s picture

Status: Needs review » Reviewed & tested by the community

Tested. Working. Fivestar widget is now visible in node panel.

dbt102’s picture

Thanks for the patches and reviews getting ready to commit this...

  • dbt102 committed 639f2c8 on 7.x-2.x authored by capuleto
    Issue #2599576 by capuleto, plopesc, dbt102: Fivestar voting widget is...
dbt102’s picture

dbt102’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.