Title: [Plugin: NextGEN Custom Fields] PHP Error Warning
Last modified: August 19, 2016

---

# [Plugin: NextGEN Custom Fields] PHP Error Warning

 *  [Brandon](https://wordpress.org/support/users/brtepley/)
 * (@brtepley)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/)
 * Is there a quick fix for this error: Warning: Attempt to assign property of non-
   object in …/wp-content/plugins/nextgen-gallery-custom-fields/ngg-custom-fields.
   php on line 555.
 * I can’t find any info on this error warning.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151002)
 * Hi brtepley
 * What version of NextGEN Gallery, and NextGEN Custom Fields are you using?
 * Also, when do you get the error?
 *  [greligioso](https://wordpress.org/support/users/greligioso/)
 * (@greligioso)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151210)
 * I am getting the same error. I get it on the post.
 * NextGEN Gallery Version 1.3.5
    NextGEN Custom Fields Version 0.5
 *  Thread Starter [Brandon](https://wordpress.org/support/users/brtepley/)
 * (@brtepley)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151212)
 * I am using 1.3.5, as well… Custom Fields 0.5.
 * I can get the field to show up in my template, everything seems to work perfectly,
   but the error message at the top of the screen.
 * I created a template based on the ‘gallery-caption’ template. I added the gallery
   to a page and when I view the page the error shows at the top, but doesn’t seem
   to effect the output. The field shows up, my layout shows up.
 * I am excited to use this plugin! I hope I can get it to work.
 * Here is line 550 – 555 -571:
 *     ```
       function nggcf_image_obj($pictureObj, $pid) {
       		global $nggcf_values;
   
       		nggcf_hold_field_values($pid);
   
       		$pictureObj->ngg_custom_fields = array();
       		foreach ($nggcf_values[$pid] as $key=>$val) {
       			$pictureObj->ngg_custom_fields[$key] = stripslashes($val->field_value);
       		}
   
       		return $pictureObj;
       	}
   
       	function nggcf_get_gallery_field($gid, $fname) {
       		global $nggcf_field_values;
   
       		nggcf_hold_gallery_field_values($gid);
   
       		return $nggcf_field_values[$gid][$fname];
       	}
       //}
       ?>
       ```
   
 *  [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151230)
 * What version of PHP are you running?
    I’m stumped. I know what the error means,
   but I can’t reproduce it. I can’t see anyway that the $pictureObj variable wouldn’t
   be an object.
 * But if you say it still works, then just try replacing line 555, currently this:
   `
   $pictureObj->ngg_custom_fields = array();` with this `@$pictureObj->ngg_custom_fields
   = array();`
 * Notice the @ symbol in front of it now. This is just a way to suppress the error.
 * I am still trying to debug this, but it’s tough without being able to get the
   error myself.
 * Let me know if that quick fix works for you! 🙂
 *  Thread Starter [Brandon](https://wordpress.org/support/users/brtepley/)
 * (@brtepley)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151239)
 * Thanks shauno! Your fix worked.
 * I am running PHP version 5.2.9.
 * Is is there anything else I can let you know that will help?
 * The plugin is exactly what I was looking for and it works perfectly!
 *  [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151245)
 * Glad the fix worked for you. I have updated the plugin to include it for future
   downloads.
 * Thanks for pointing out the bug, it’s always good to get feedback!
 *  [rdimou](https://wordpress.org/support/users/rdimou/)
 * (@rdimou)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151360)
 * Ok thanks this with the @ symbol helped to supress the warnings. but how we solve
   this problem? what is it?
 *  [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151361)
 * Hey rdimou
    Basically it appears as though the `$pictureObj` variable was not
   coming through as an object as expected. Because PHP is loosely typed, and doesn’t
   require me to declare my variable as an array before using it as one, it won’t
   break the code to just suppress the error. Not ideal, but that’s the cost of 
   free 🙂
 * I am working on a new release, but I have to wait for the new release of NextGEN
   before I can complete it.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘[Plugin: NextGEN Custom Fields] PHP Error Warning’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 4 participants
 * Last reply from: [shauno](https://wordpress.org/support/users/shauno/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-nextgen-custom-fields-php-error-warning/#post-1151361)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
