Title: Widget code error
Last modified: January 13, 2024

---

# Widget code error

 *  Resolved [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * (@mbsharp)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/widget-code-error-2/)
 * in …src/Widget.Gallery.php there is an error at line 216 and line 308 where key‘
   widget-id’ is undefined or invalid.
 * Widgets display OK in production but error thrown when editing and two widgets
   with different galleries show the same ‘gallery’ appearance.

Viewing 1 replies (of 1 total)

 *  Thread Starter [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * (@mbsharp)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/widget-code-error-2/#post-17344245)
 * Correction. widget-id is a constant. The error is in $args[‘widget-id’] ie the
   array value is undefined or invalid.

Viewing 1 replies (of 1 total)

The topic ‘Widget code error’ 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/)

 * 1 reply
 * 1 participant
 * Last reply from: [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/widget-code-error-2/#post-17344245)
 * Status: resolved