Title: ERROR Warning Creating default object when adding gallery???
Last modified: August 21, 2016

---

# ERROR Warning Creating default object when adding gallery???

 *  [Brandon Moner](https://wordpress.org/support/users/ctvonline/)
 * (@ctvonline)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/error-warning-creating-default-object-when-adding-gallery/)
 * I’m not sure what happened, but I’m getting ALL KINDS of erros when trying to
   add a gallery to a page.
 * I know that it happened after I used a Revision Cleaner plugin to clean out all
   of the revisions and versions of pages that were on the site.
 * These keep popping up:
 *     ```
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
   
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
   
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
   
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
   
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
   
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
   
       Warning: Creating default object from empty value in /*/rop_live/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php on line 223
       ```
   
 * [http://wordpress.org/plugins/nextgen-gallery/](http://wordpress.org/plugins/nextgen-gallery/)

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

 *  [Frank Hagan](https://wordpress.org/support/users/frank-hagan/)
 * (@frank-hagan)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/error-warning-creating-default-object-when-adding-gallery/#post-4005660)
 * Your web host probably upgraded to PHP 5.4. My understanding is that this error
   message really doesn’t DO anything other than annoy you, so its safe to turn 
   off the display of it.
 * In wp-config.php, put this line:
 * `ini_set( 'display_errors', 0 );`
 * I put it near the top, under:
 * >  * [@package](https://wordpress.org/support/users/package/) WordPress
   >  */
 *  [Mei Gwilym](https://wordpress.org/support/users/meigwil/)
 * (@meigwil)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-warning-creating-default-object-when-adding-gallery/#post-4005842)
 * Turning off display errors only hides the problem.
 * To fix, add this code on line 235 of file nextgen-gallery/products/photocrati_nextgen/
   modules/attach_to_post/mixin.attach_to_post_display_tab.php (for version 2.0.40).
 * `if(is_null($model)) $model = new \stdClass();`
 * which should be before `$model->settings = $settings;`.
 * Mei

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

The topic ‘ERROR Warning Creating default object when adding gallery???’ is closed
to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [default](https://wordpress.org/support/topic-tag/default/)
 * [object](https://wordpress.org/support/topic-tag/object/)
 * [permissions](https://wordpress.org/support/topic-tag/permissions/)
 * [Revision](https://wordpress.org/support/topic-tag/revision/)

 * 2 replies
 * 3 participants
 * Last reply from: [Mei Gwilym](https://wordpress.org/support/users/meigwil/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/error-warning-creating-default-object-when-adding-gallery/#post-4005842)
 * Status: not resolved