Hello,
I have installed component module v 1.1.4.2 2010/07/02 and when i try to call back a view with .load, i got this error :
Fatal error: func_get_args():
Can't be used as a function parameter in /sites/all/modules/component/component.module on line 85
So what i did is to replace this :
function component_get_view() {
return call_user_func_array('views_embed_view', func_get_args());
}
by this : (comes from component.module file from component module v 1.1.4.1 2008/12/02)
function component_get_view($view_name, $display) {
$args = func_get_args();
unset($args[0]);
unset ($args[1]);
$v = views_get_view($view_name);
$v->set_display($display);
$v->set_arguments(array_values($args));
$v->pre_execute();
$v->execute();
return $v->render();
}
and everything worked just fine.
But maybe ther is a better way to solve this issue ?
David
Comments
Comment #1
Crell commentedWhat version of PHP are you running? That could be version-dependent, and to be honest I've not used this module in a very long time, not since views_attach was released. :-)
Comment #2
mr.j commentedSame problem (php 5.2). As it states in the PHP docs http://be.php.net/manual/en/function.func-get-args.php
The solution is simple - just copy the args into a variable (like it does elsewhere in the module anyway).
Comment #3
Crell commented#2 is not a patch. Please submit an actual patch file.
Comment #4
rlnorthcuttClosing old issue