Attached is a patch to fix this warning. The file object is never initiated, so this causes warnings.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Johnny vd Laar’s picture

Status: Active » Needs review
potofski’s picture

patch works for me. Thanks

Uv516’s picture

The patch didn't work for me.
Instead of

+  $file = (object) array();
   $file->filename = isset($settings['filename']) ? $settings['filename'] : '';
   $file->oldfilename = isset($settings['oldfilename']) ? $settings['oldfilename'] : '';
   $file->filepath    = isset($settings['filepath']) ? $settings['filepath'] : '';

I use:

+ $file = new ArrayObject();
   $file->filename = isset($settings['filename']) ? $settings['filename'] : '';
   $file->oldfilename = isset($settings['oldfilename']) ? $settings['oldfilename'] : '';
   $file->filepath    = isset($settings['filepath']) ? $settings['filepath'] : '';

and now it works for me.

Dean Clayton’s picture

original patch didn't work, but the change listed in #3 worked for me

kyletaylored’s picture

Title: Warning: Creating default object from empty value in _user_import_settings_save() (line 574 of /var/www/html/test.xyz.v7/sites/all/modules/user_import/user_import.module). » Warning: Creating default object from empty value in _user_import_settings_save() (line 574 of user_import/user_import.module).
FileSize
527 bytes

I'm rolling #3 into a patch and fixing the paths (should be relative to the module root)

scotwith1t’s picture

Status: Needs review » Reviewed & tested by the community

+1 for the patch in #5. Thanks all!

bruiseviolet’s picture

Patch in #5 worked for me too! Thank you!

Robert Castelo’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-2.x-dev branch.

Will roll a new release once I've gone through the other ready for review issues.

Status: Fixed » Closed (fixed)

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

Nchase’s picture

patch works. latest dev as well. thank you!