Title: error on saving post with empty gallery
Last modified: April 4, 2017

---

# error on saving post with empty gallery

 *  Resolved [ugy](https://wordpress.org/support/users/ugy/)
 * (@ugy)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/error-on-saving-post-with-empty-gallery/)
 * Hi Navneil,
    I had a problem saving a post with an empty gallery. It was throwing
   an error:
 * > Notice: Undefined index: gallery in /Users/***/*****/htdocs/steelroots/wp-content/
   > plugins/navz-photo-gallery/fields/acf-photo_gallery-v4.php on line 15
 * so I changed line 15 in fields/acf-photo_gallery-v4.php to include a check to
   see if a gallery was actually being posted:
 * `$ids = !empty($field) && isset($_POST[$field_id])? $_POST[$field_id]: null;`
 * I hope this is helpful.
    Cheers!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Navneil Naicker](https://wordpress.org/support/users/navzme/)
 * (@navzme)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/error-on-saving-post-with-empty-gallery/#post-8993022)
 * Awesome thanks once again for your contribution.

Viewing 1 replies (of 1 total)

 The topic ‘error on saving post with empty gallery’ is closed to new replies.

 * ![](https://ps.w.org/navz-photo-gallery/assets/icon-128x128.png?rev=2607741)
 * [ACF Photo Gallery Field](https://wordpress.org/plugins/navz-photo-gallery/)
 * [Support Threads](https://wordpress.org/support/plugin/navz-photo-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/navz-photo-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/navz-photo-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/navz-photo-gallery/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Navneil Naicker](https://wordpress.org/support/users/navzme/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/error-on-saving-post-with-empty-gallery/#post-8993022)
 * Status: resolved