recaptcha_secure_connection went out of use with #1827922: Always use HTTPS to communicate with reCAPTCHA servers. See patch in parent.

Comments

Liam Morland’s picture

Issue summary: View changes
hass’s picture

Liam Morland’s picture

Title: Remove variable recaptcha_secure_connection » Remove obsolete variable recaptcha_secure_connection
Liam Morland’s picture

Title: Remove obsolete variable recaptcha_secure_connection » Remove obsolete variables
  • recaptcha_secure_connection
  • recaptcha_mailhide_public_key
  • recaptcha_mailhide_private_key
  • recaptcha_api_server
  • recaptcha_api_secure_server
  • recaptcha_verify_server
Liam Morland’s picture

The only way to reliably remove all obsolete recaptcha_* variables is code like the following (saving and resetting variables to keep), instead of using variable_del():

  db_delete('variable')
    ->condition('name', 'recaptcha_%', 'LIKE')
    ->execute();
  cache_clear_all('variables', 'cache');

Is there any reason why this is not a good way to do it?

I note that each call to variable_del() calls cache_clear_all(). If using a single query, cache_clear_all() can be called once instead.

hass’s picture

This is not a performance question. You may delete other modules variables. e.g. recaptcha_foo modules variables will be deleted by fault. This will cause data loss. You will also delete the variables from recaptcha_mailhide submodule if the base module is uninstalled. This is not correct. The submodule need to remove it's variables on its own.

What is the problem with deleting only the variables of the module? This need to be a small and well known list.

Liam Morland’s picture

recaptcha_mailhide used to have variables named "recaptcha_mailhide_public_key_$format". So, unless you know the list of the possible values for $format, there is no way to remove all such variables.

I see the problem and will make an update hook that just removes the known variable names. Thanks.

hass’s picture

Well recaptcha_mailhide_public_key_$format is very specific and deep "nested" and can be removed this way for sure.

  • Liam Morland committed e7c2342 on 7.x-1.x
    Issue #2473329: Add recaptcha_update_7100() to remove obsolete variables...
Liam Morland’s picture

Status: Active » Fixed

  • Liam Morland committed 99ef2bc on 7.x-1.x
    Issue #2473329: Remove obsolete variables from recaptcha_mailhide.
    
hass’s picture

Just one question about the upgrade to 2.x. Is this the full list of all variables that may need to be dropped?

  • recaptcha_secure_connection
  • recaptcha_mailhide_public_key_*
  • recaptcha_mailhide_private_key_*
  • recaptcha_api_server
  • recaptcha_api_secure_server
  • recaptcha_verify_server

as there is no mailhide for the 2.0 API I'm not finally sure we should drop or leave as is for now. Maybe the feature is added later by Google and than we could upgrade the variables later or people need to reconfigure.

  • recaptcha_mailhide_public_key_*
  • recaptcha_mailhide_private_key_*

I hate stale variables and would at least add them to the uninstall hook so nothing is left behind. What do you think?

Liam Morland’s picture

In addition to recaptcha_mailhide_public_key_* and recaptcha_mailhide_private_key_*, you need to get rid of recaptcha_mailhide_public_key and recaptcha_mailhide_private_key (without the "_*").

Or just get rid of recaptcha_mailhide_*; it doesn't use any variables anymore. I have just added an update hook to recaptcha_mailhide which does this.

hass’s picture

Ok, than we can instruct people to upgrade to latest 7.x-1.13 or later before they upgrade to 7.x-2.0

Liam Morland’s picture

Technically, they might be upgrading from D6. You could have a 7200 upgrade hook that does the deletion as well.

hass’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Assigned: Liam Morland »
Status: Fixed » Patch (to be ported)

  • hass committed 183ba7c on 7.x-2.x
    Issue #2473329 by hass: Remove obsolete variables
    
hass’s picture

Status: Patch (to be ported) » Fixed

  • hass committed 183ba7c on 6.x-2.x
    Issue #2473329 by hass: Remove obsolete variables
    

Status: Fixed » Closed (fixed)

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