A 4th argument "$language" is either missing or not needed:

Warning: Missing argument 4 for fivestar_entity_view() in fivestar_entity_view() (line 516 

Change
function fivestar_entity_view($entity, $type, $view_mode, $langcode) {

To
function fivestar_entity_view($entity, $type, $view_mode) {

$langcode is not used in that function anyway - maybe this was left for a future feature?

Comments

ericduran’s picture

Status: Active » Closed (works as designed)

This was left in there for the future.

But the 4 arg belongs there according to http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...

ericduran’s picture

Also do you know how you got that warning?

iajay’s picture

Even I have this same error...
This comes when the fivestar rating block is added to a panel page, i have overridden a node type page with a panel page, and added the fivestar rating block to the panel page... Any solutions?
Kind regards
Ajjaykummar

Anonymous’s picture

Status: Closed (works as designed) » Active

I have the same as #3, showing the fivestar widget somewhere in a node panel.

Maybe you can fix it like this:

function fivestar_entity_view($entity, $type, $view_mode, $langcode = NULL) { 

Set default to NULL?

ericduran’s picture

Hmm,

If this is indeed a problem then there's either a bug in core, in panel, or in the docs. So I will not change this until the root cause of the issue is found.

The hook_entity_view is supposed to pass in all 4 values. I'm not going to add null in order to support broken code somewhere.

We should find the actual issue.

ericduran’s picture

Can someone give me directions on how to replicate this bug so I can look into it?

Thanks ;)

ericduran’s picture

ok, I think I found it, it seems like a ctools bug

ericduran’s picture

Status: Active » Closed (works as designed)

Ok a little investigating and this issue has already been fixed -- #1173928: Invoking 'entity_view' required $langcode

Update to the latest dev version of ctools and this problem will go away.

iajay’s picture

thanks for the solution
upgrading to ctools 7.x-1.0-beta1 solved the problem