fivestar_field_prepare_view isn't triggered

Created on 22 February 2012, about 13 years ago
Updated 11 October 2023, over 1 year ago

Hi(ericduran). I'm working on reply module which is basically an attachable entity(ie. through field can be attached to another entity) and I've noticed that when I'll use fivestar field with it I get these errors:

Notice: Undefined index: average in ..\fivestar\includes\fivestar.field.inc on line 525
Notice: Undefined index: average in ..\fivestar\includes\fivestar.field.inc on line 570
Notice: Undefined index: count in ..\fivestar\includes\fivestar.field.inc on line 571

So I've looked at you'r code and found out that those missing indexes are set in fivestar_field_prepare_view. I have also found that this hook isn't triggered which is surprising. So I've tried to see if this hook is triggered with another(not fivestar) fields and it turned out it is. I haven't gone through your whole code so I have to ask: is there some unusual logic that you are using that coul'd be the reason of this behavior? I think that my module is responsible for this but since the hooks of other fields are triggered I thought I'll give it a shot.

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    No further reports of this behavior, and the Reply module hasn't been worked on in almost 10 years.

    fivestar_field_prepare_view() is an implementation of the core hook hook_field_prepare_view(). I don't know of any situation that could happen to prevent core from invoking a valid hook function, unless fivestar.field.inc wasn't loaded into memory in the first place. Drupal 7 DID have problems with include files like this where they weren't always loaded when needed, but that's not something we can really track down here so many years after the fact.

    If this continues to be a problem for someone, please open a new issue.

Production build 0.71.5 2024