Using you module with PHP 5.3, I got some PHP warnings (when running update.php, at the result screen). I think some of these errors might reveal underlaying errors.

I don't have any bugs myself, but you should do a quick review of these:

# Notice: Undefined variable: context in i18nstrings_remove() (line 1208 of /var/www/drupal-installation-profiles/testing/modules/contrib/i18n/i18nstrings/i18nstrings.module).
# Notice: Trying to get property of non-object in i18nstrings_location() (line 811 of /var/www/drupal-installation-profiles/testing/modules/contrib/i18n/i18nstrings/i18nstrings.module).
# Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /var/www/drupal-installation-profiles/testing/modules/contrib/i18n/i18nstrings/i18nstrings.module).
# Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /var/www/drupal-installation-profiles/testing/modules/contrib/i18n/i18nstrings/i18nstrings.module).
# Notice: Trying to get property of non-object in i18nstrings_params() (line 784 of /var/www/drupal-installation-profiles/testing/modules/contrib/i18n/i18nstrings/i18nstrings.module).

I'm going to make a quick and dirty patch to shut up the errors, but doing too much isset() or empty() tests won't make debuging easier.

Comments

pounard’s picture

I see at least one or two of theses which seems to be OK.

i18nstrings.module, line 815 is:

if ($context->property) {

You might want to write, in order to avoid such PHP warnings (for 5.3 only):

if (isset($context->property) && !empty($context->property)) {

This should still give some warnings, because if $context is not an object, then PHP will warn about a property access attempt on a non existing object.

It seems that in the i18ntrings_location() function, you never test if the $context parameter is empty or not, but it seems that in the use case I'm currently dealing with, the method attempt to run with an non object variable (it also might be a wrong usage of this module by another third party module).

LSU_JBob’s picture

I'm getting a whole slew of these errors whenever I save modules or run update.php

* Notice: Undefined variable: context in i18nstrings_remove() (line 1208 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 811 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_params() (line 784 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Undefined variable: context in i18nstrings_remove() (line 1208 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 811 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_params() (line 784 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Undefined variable: context in i18nstrings_remove() (line 1208 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 811 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_location() (line 813 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Trying to get property of non-object in i18nstrings_params() (line 784 of /Developer/testproject/docroot/sites/all/modules/i18n/i18nstrings/i18nstrings.module).
* Notice: Undefined index: configurable in actions_synchronize() (line 323 of /Developer/testproject/docroot/includes/actions.inc).

I tried your small fix pounard but to no avail. How can I stop these notices from coming up whenever I save modules or run update.php?

LSU_JBob’s picture

StatusFileSize
new499 bytes

Here's a patch I made to at least get rid of these annoying errors. Don't know how solid it is.

damienmckenna’s picture

FYI I get this error with drush 4.0-dev on PHP 5.2.13 when I enable a module.

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new9.5 KB

patch in #3 is for the context module & it appears that has been fix in it.

Here is a patch that fixes the error on update.php for us. Also fixes some white-space formatting issues.

jose reyero’s picture

Component: Code » Blocks
Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

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

Aleksey Zubko’s picture

Version: 6.x-1.5 » 6.x-1.9
Status: Closed (fixed) » Active
StatusFileSize
new923 bytes

Here is a patch that fixes the notice on node/add page.

joseph.olstad’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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