Strict warning: Only variables should be passed by reference in google_fonts_admin_settings_form() (line 81 of /opt/lampp/htdocs/d7_animare/sites/all/modules/google_fonts/google_fonts.admin.inc).
Strict warning: Only variables should be passed by reference in google_fonts_admin_settings_form() (line 119 of /opt/lampp/htdocs/d7_animare/sites/all/modules/google_fonts/google_fonts.admin.inc).

Comments

BarisW’s picture

Status: Active » Postponed (maintainer needs more info)

Not sure what this is, but I cannot reproduce it. At the line numbers you give (81 and 119) no variables are passed by reference. Do you still get this error? If so: could you please clarify what system you are using?

slayne40’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hy,

Strict warning : Only variables should be passed by reference in google_fonts_admin_settings_form() (line 119 in google_fonts/google_fonts.admin.inc).

Due to PHP 5.3, it's more strict for variable pass by reference.

line 119 :

$first_family = $form_options['enabled'][array_shift(array_keys($form_options['enabled']))]->family;

PHP syntax for array_shift : mixed array_shift ( array &$array )

The $array variable need to pass by reference.

Replace ligne 119 by :

$enabled_keys = array_keys($form_options['enabled']);
$first_family = $form_options['enabled'][array_shift($enabled_keys)]->family;
TMHD’s picture

Hi

I replaced line 119, and that worked fine , but what should I replace line 81 with ?

blacksnipe’s picture

No idea if you solved it, but it's actually kind of the same problem of reference.

replace rule 81:

$enabled_fonts[$key]['variants'] = array(array_shift(_google_fonts_admin_array_values($font->variants)));

with:

$array_vals = _google_fonts_admin_array_values($font->variants);
$enabled_fonts[$key]['variants'] = array(array_shift($array_vals)); 

cheers,
A.

druplr’s picture

Issue summary: View changes

Thank you slayne40. Warning is gone for me.