Title: Widget code error
Last modified: July 26, 2024

---

# Widget code error

 *  Resolved [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * (@mbsharp)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/)
 * When editing widgets including one or more Nextgen widgets, there is an error
   for missing value of ‘widget-id’ in …/src/Widget.Gallery.php at both of lines
   308 and 216. Only if editing: the widgets display correctly afterwards. 
   WP 6.6.1,
   PHP 8.1

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

 *  [Barsha Paudel](https://wordpress.org/support/users/barsha05/)
 * (@barsha05)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/#post-17923296)
 * Hi [@mbsharp](https://wordpress.org/support/users/mbsharp/),
 * Thanks for reaching out!
 * While checking on our setup we couldn’t replicate the issue while using the PHP
   8.1 and NextGEN Gallery. I suggest you download a fresh copy of the latest NextGen
   Gallery and, then replace the one from your site’s **Dashboard > Plugins > Add
   new plugin > Upload plugin > Choose File** (with the files’ override when being
   asked) to see if that’ll fix the issue?
 * Re-installing NextGen Gallery wouldn’t affect your existing galleries.
 * Thanks!
 *  Thread Starter [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * (@mbsharp)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/#post-17923428)
 * Thanks for your reply. The issue reported is showing up on three different sites
   all with the same php and WP versions, and with fully up to date NGGallery. So
   I would rule out a code file corruption.
 * It might be related to the theme which is Weaver Xtreme in all three cases.
 * As it stands, the only operational problem is the creation of lines in the error
   log and the widgets do not display correctly in the block editor. It has been
   this way for a very long time ie, years, and across numerous NG versions. I can
   work around it.
 *  [Barsha Paudel](https://wordpress.org/support/users/barsha05/)
 * (@barsha05)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/#post-17930274)
 * Hi [@mbsharp](https://wordpress.org/support/users/mbsharp/),
 * Thanks for the update,
 * As mentioned earlier, we couldn’t replicate the issue on our end while using 
   the NextGEN Gallery, I suspect it to be an issue with the theme activated on 
   all the three site of yours.
 * Could you please try once deactivating the theme Weaver Xtreme and check if it
   resolves the issue or not!
 * Also, with the upcoming NextGEN Gallery release, we will be fixing most of the
   PHP errors appearing with the plugin. So in case it’s related to the plugin, 
   the issue might be resolved once the plugin is updated to the new version.
 * Thanks!
 *  Thread Starter [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * (@mbsharp)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/#post-17930528)
 * As Weaver Xtreme is the only theme I use and have loaded, I cannot deactivate
   it to test. Al the problem is relatively trivial I will just wait and see if 
   it gets cured sometime.
 *  Thread Starter [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * (@mbsharp)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/#post-17943743)
 * I contacted Weaver Xtreme support. They suggested installing the Classic Widget
   plugin which reverts widget editing from the block editor to the classic editor.
   This proves to be the complete cure. No PHP errors thrown from the NextGen code
   now.

Viewing 5 replies - 1 through 5 (of 5 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [mbsharp](https://wordpress.org/support/users/mbsharp/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/widget-code-error-3/#post-17943743)
 * Status: resolved