This module throws "Strict warning: Creating default object from empty value in noderefcreate_autocomplete_validate". This error is because the code instantiated a default object (of type stdClass) implicitely. PHP is strict and doesn't accept this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Begun’s picture

Status: Active » Needs review
FileSize
1.54 KB

Forgot to attach patch.

SocialNicheGuru’s picture

patch does not apply cleanly... i.e. changes to .info

charlie-s’s picture

It also undoes what is referenced at http://drupal.org/node/1295112. Why are lines 88/89 being reverted? Isn't changing $newobject to new stdClass() instead of NULL adequate for this particular bug?

pringlz’s picture

Issue summary: View changes

Hi! in 2012 was created patch from #1 comment. Now stable version is not patched! In 2014! Please, everybody, change the stable version 7.x-1.0 with this patch!

gusantor’s picture

Hello

I'm using drupal 7.39, noderefcreate 7.x-1.0, install profile Minimal (minimal-7.39)

receiving this message when trying to create a node with field collection item with a noderefcreate field control

Warning: Creating default object from empty value en noderefcreate_autocomplete_validate() (línea 133 de /opt/dafweb/drupal/sites/all/modules/noderefcreate/noderefcreate.module).

I applied the patch in #1 , get 1 error

so I decided to copy noderefcreate.info, noderefcreate.module from a standard profile installation, warning gone

lucky me !

thanks

nico.knaepen’s picture

  1. +++ b/noderefcreate.info
    @@ -7,3 +7,10 @@ dependencies[] = references
    +
    

    This part is already available in the 7.x-1.0. No need to re-apply this through a patch.

  2. +++ b/noderefcreate.module
    @@ -85,8 +85,8 @@ function noderefcreate_field_widget_form(&$form, &$form_state, $field, $instance
    +  $field = $form_state['field'][$element['#field_name']][$element['#language']]['field'];
    

    These changes are also included in version 7.x-1.0. Also no need to re-apply changes on this.

  3. +++ b/noderefcreate.module
    @@ -127,7 +127,7 @@ function noderefcreate_autocomplete_validate($element, &$form_state, $form) {
    +        $newnode = new stdClass();
    

    This is the only change that matters.