When I go to the configuration page I get the following error and nothing else is displayed:
Warning: Parameter 1 to google_fonts_admin_settings_form() expected to be a reference, value given in drupal_retrieve_form() (line 766 of /home/username/public_html/includes/form.inc).
Thanks

Comments

BarisW’s picture

Assigned: Unassigned » BarisW

Thanks for reporting, I'll have a look. I figure something has changed with Drupal7 since the release of 7.x-1.2 that broke this.

Aonoa’s picture

I'm experiencing this as well on D7 RC2 and latest google_fonts-7.x-1.x-dev.

Best regards,
Ao

BarisW’s picture

Status: Active » Fixed

Fixed in 7.x-1.3, thanks!

Aonoa’s picture

Thank you, but is the 7.x-1.3 archive supposed to only contain the module file?

Best regards,
Ao

BarisW’s picture

See #1003754: 7.x-1.3 - missing info file, I made a mistake with the release. Apologies, I've added a new one!

Aonoa’s picture

Status: Fixed » Active

I am still getting this error with 7.x-1.4. To be sure, I re-installed D7 RC2 and installing/enabling this module was the first thing I did afterwards.

Best regards,
Ao

Aonoa’s picture

I can add that opening the "Add rules" tab gives this error as well:

Warning: Parameter 1 to google_fonts_ui_admin_settings_form() expected to be a reference, value given in drupal_retrieve_form() (line 766 of /var/www/example.com/demo/includes/form.inc).

Best regards,
Ao

jerrac’s picture

Version: 7.x-1.2 » 7.x-1.4

Same thing in 7.x-1.4. Fresh install of D7 RC3.

jerrac’s picture

Ok, I'm a bit confused... In google_fonts.admin.inc I changed:
function google_fonts_admin_settings_form(&$form_state)
To:
function google_fonts_admin_settings_form($form_state)

And it shows the forms correctly.

Which shouldn't be correct since http://api.drupal.org/api/drupal/modules--node--node.api.php/function/ho... says to pass form_state by reference...

Same story for google_fonts_ui_admin_settings_form($form_state) in google_fonts_ui.admin.inc

izus’s picture

hello world
I just tested the module on drupal 7 rc 3 and got the same error:
Warning: Parameter 1 to google_fonts_admin_settings_form() expected to be a reference, value given in drupal_retrieve_form() (line 771 of /path/drupal7rc3/includes/form.inc).

BarisW’s picture

Hmmm, strange. Even with all errors on (php settings) I am getting no errors.
However, I see that in Drupal 7, form functions expect a $form AND &$form_state.

For example: http://api.drupal.org/api/drupal/modules--comment--comment.admin.inc/fun...

So I think that if I change

function google_fonts_admin_settings_form(&$form_state) {} to
function google_fonts_admin_settings_form($form, &$form_state) {}

the error is gone. Same goes for google_fonts_ui_admin_settings_form

Would you please test if this works for you?

Aonoa’s picture

Indeed, it works when set to the following in google fonts and google fonts ui:

function google_fonts_admin_settings_form($form, &$form_state) {}

Thank you.

Best regards,
Ao

serg2’s picture

Running RC3:
I had the warning on the Config page and was unable to use the module.
When adding "$form, " the module works and warning disappear.

This is a really nice module, now i have to pick my fonts!! :)

BarisW’s picture

Status: Active » Fixed

Fixed in 7.x-1.5. Thanks for helping me on this bug!

Status: Fixed » Closed (fixed)

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