when I clear cache with drush, I got some notices caused by input_formats:

WD php: Notice: Undefined property: stdClass::$in_code_only in input_formats_load_all() (line 772 of [error]
input_formats/input_formats.module).
WD php: Notice: Undefined property: stdClass::$in_code_only in input_formats_load_all() (line 785 of [error]
input_formats/input_formats.module).
WD php: Notice: Undefined index: description in ctools_content_process() (line 72 of [error]
ctools/includes/content.inc).
WD php: Notice: Undefined property: stdClass::$in_code_only in input_formats_strongarm() (line 82 of [error]
input_formats/input_formats.module)
WD php: Notice: Undefined property: stdClass::$settings in _ctools_export_unpack_object() (line 601 of [error]
ctools/includes/export.inc).
WD php: Notice: Undefined index: fields in _ctools_export_unpack_object() (line 609 of [error]
ctools/includes/export.inc).

Any ideas why these notices appears?

Comments

dagmar’s picture

They seems PHP 5.3 warnings.

IRuslan’s picture

StatusFileSize
new857 bytes

About
WD php: Notice: Undefined property: stdClass::$settings in _ctools_export_unpack_object() (line 601 of [error]
ctools/includes/export.inc).

This patch helps for me.
This strings define field options, but they are not present in table, so that's why ctools invoke notice, while unpacking object.

IRuslan’s picture

About
WD php: Notice: Undefined index: fields in _ctools_export_unpack_object() (line 609 of [error]
ctools/includes/export.inc).

see #1228468: PHP notice "WD php: Notice: Undefined index: fields in _ctools_export_unpack_object()"

IRuslan’s picture

StatusFileSize
new2.88 KB

About notices lie that:
WD php: Notice: Undefined property: stdClass::$in_code_only in input_formats_load_all() (line 785 of [error]
input_formats/input_formats.module).

It caused because ctools export not always set in_code_only object proterty, and as a result we get notice on calls like $input_format->in_code_only.

On my point of view now easier add empty() or isset() instead investigation of correct behavior ctools module and setting up in_code_only to FALSE in proper places.

thedavidmeister’s picture

Status: Active » Needs review

Patch in #4 works, superficially at least.

thedavidmeister’s picture

StatusFileSize
new3.19 KB

Actually, I still was getting a notice for use of an undefined index in input_formats_get_roles()

This patch extends on #4 but includes an isset() for that function too.

I do however feel that sprinkling empty() and isset() everywhere is not really the correct solution, input_formats_load_all() should merge in a default of something falsey for $input_formats->in_code_only so when it isn't set as it is loaded it gets mopped up right at the source. For that reason I'm setting this to needs work.

Fix should probably go around here inside input_formats_load_all():

      elseif (empty($input_format->in_code_only)) {
        // Settings for this input format are storaged in the database
        $input_format->settings = input_formats_get_settings($input_format);
        $input_format->roles = input_formats_get_roles($input_format);
        $input_format->filters = input_formats_get_filters($input_format);
      }

The site I'm using this module on the most is moving to D7 in the next month or two, so I can't really justify spending time implementing or testing this idea extensively, sorry!

thedavidmeister’s picture

Status: Needs review » Needs work