Title: error updating settings
Last modified: August 21, 2016

---

# error updating settings

 *  [oakhillman](https://wordpress.org/support/users/oakhillman/)
 * (@oakhillman)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-updating-settings/)
 * Getting the following error when trying to update settings.
 * —————————-
    Warning: Invalid argument supplied for foreach() in /home/content/
   36/8457736/html/conexioneslatinas/wp-content/plugins/document-gallery/admin/class-
   admin.php on line 369
 * Warning: Invalid argument supplied for foreach() in /home/content/36/8457736/
   html/conexioneslatinas/wp-content/plugins/document-gallery/admin/class-admin.
   php on line 374
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/content/36/8457736/html/conexioneslatinas/wp-content/plugins/document-
   gallery/admin/class-admin.php:369) in /home/content/36/8457736/html/conexioneslatinas/
   wp-includes/pluggable.php on line 1121
    —————————-
 * I was getting an error on the website page but just after update WordPress to
   3.9.1. Decided to uninstall your plugin and reinstall. Looks like the page is
   displaying correctly now with the default settings I assume since I’m getting
   the above error message when I try to update them.
 * Here’s one of the pages where I’m using the [dg] shortcode.
 * [http://conexioneslatinas.org/archivos/](http://conexioneslatinas.org/archivos/)
 * [https://wordpress.org/plugins/document-gallery/](https://wordpress.org/plugins/document-gallery/)

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

 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111421)
 * Hi oakhillman,
 * I’m sorry you’ve run into issues with Document Gallery. Can you clarify a few
   details about the problems you’re having? With more information I’ll have a better
   chance of narrowing down what might be creating this issue.
 * 1. Were the error messages you describe showing up prior to the update to WP 
   version 3.9.1?
 * 2. What was the WP version you were running prior to the update?
 * 3. After uninstalling DG and reinstalling, does the issue reappear if you try
   to edit the settings again?
 * 4. Do those error messages all appear on the same page? Is it on the admin side
   or where you use the shortcode (the frontend)?
 * -Dan
 *  Thread Starter [oakhillman](https://wordpress.org/support/users/oakhillman/)
 * (@oakhillman)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111480)
 * Dan,
 * Here are the responses to your queries.
 * 1. Not that I’m aware of.
 * 2. Best I can say is 3.8.x.
 * 3. As I mentioned, this is what I did and yes, the issue persists. But just to
   be sure I just uninstalled and reinstalled it, and again, the issue persists.
 * 4. All on the same page, and the page contains just the error messages, the rest
   of the page is blank. It occurs when I click on the “Save Changes” button in 
   the back-end of course.
 * – Mark
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111495)
 * Thanks for the additional information!
 * I’m looking into the issue now, but there’s one more piece of information that
   would be useful. It’s a bit challenging to get and requires you to access the
   DB directly, but if you can do it then it will increase the odds that I can isolate
   what is happening.
 * What you need to do is run the following against your WP database:
    `SELECT option_value
   FROM wp_options WHERE option_name = 'document_gallery'` (Note that “wp_options”
   could have a prefix other than “wp_” depending on your config settings.)
 * Not knowing what your setup looks like, unfortunately I can’t be very specific
   in terms of exactly how you should go about running this, but if you have specific
   questions I’ll be happy to help in any way I can.
 * Thanks!
    -Dan
 * PS: If you’ve found this plugin useful, please take a moment to [rate it](http://wordpress.org/support/view/plugin-reviews/document-gallery#postform).
   Thanks! 🙂
 *  Thread Starter [oakhillman](https://wordpress.org/support/users/oakhillman/)
 * (@oakhillman)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111557)
 * Here’s the value in the field for your record.
 * a:3:{s:7:”gallery”;a:1:{s:8:”defaults”;a:9:{s:5:”order”;s:3:”ASC”;s:7:”orderby”;
   s:6:”author”;s:8:”relation”;s:3:”AND”;s:13:”attachment_pg”;b:0;s:12:”descriptions”;
   b:0;s:5:”fancy”;b:0;s:3:”ids”;b:0;s:6:”images”;b:0;s:9:”localpost”;b:0;}}s:7:”
   version”;s:3:”2.1″;s:3:”css”;a:2:{s:13:”last-modified”;s:25:”Fri, 18 Jul 2014
   19:46:19″;s:4:”etag”;s:32:”3795ddb780ec01beb644a144c3c0b119″;}}
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [12 years ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111604)
 * Thanks oakhillman,
 * That’s very helpful. I’ll be looking into this.
 * -Dan
 *  Thread Starter [oakhillman](https://wordpress.org/support/users/oakhillman/)
 * (@oakhillman)
 * [12 years ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111634)
 * Dan,
    Any progress on resolving this issue? – Mark
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [12 years ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111644)
 * Hi Mark,
 * Yes, I’m very sorry for the delay. “Real” work has been quite hectic the past
   few weeks and I’ve had limited time to keep up with DG issues.
 * This one actually has me stumped. The obvious issue is that a segment of the 
   options (which you reported above) is missing. This segment is necessary for 
   the plugin to function and is the reason things are breaking. What is not clear
   is *why* it’s missing. Since uninstalling and reinstalling doesn’t resolve the
   issue doesn’t fix the problem, that means that the issue is not a one-off quirk,
   but something that is recreated over and over again.
 * My plan is to insert a safe guard against poorly foormed options being saved 
   and adding extra logging along with this so that we can figure out where the 
   bad option value is coming from. I’m hoping this will be relatively straightforward,
   but it may be a week or so before I can get it together.
 * Again, I am very sorry for the delay. I know it is quite inconvenient.
 * -Dan
 *  Thread Starter [oakhillman](https://wordpress.org/support/users/oakhillman/)
 * (@oakhillman)
 * [12 years ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111645)
 * Oh gosh, no problem Dan. I was just checking. The site owner doesn’t even know
   there’s a problem because they would never update any settings without my help.
 * Are you able to duplicate the issue on your end? If you want, I can install a
   site for testing. I have extra domains and unlimited hosting with GoDaddy.
 * – Mark
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [12 years ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111647)
 * Hi Mark,
 * We are not able to reliably reproduce over here so if you could setup an environment
   that reproduces the issue that would be extremely helpful!
 * If you want to continue this conversation via email, the best way to start that
   would be through my site ([http://dan.rossiters.org/contact-me/](http://dan.rossiters.org/contact-me/)).(
   Don’t like posting my email on a public forum.)
 * Thanks so much for your willingness to help in narrowing down the origin of this
   issue!
 * -Dan
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111666)
 * Hi Mark,
 * We’ve just released version 2.2 which includes some new features designed to 
   prevent saving invalid options like what you were experiencing.
 * After installing the new version, if you navigate to Dashboard -> Settings ->
   Document Gallery -> Advanced tab and check the validate options checkbox your
   system will no longer be able to save an invalid option structure. Please let
   me know if this helps at all with the issues you’ve been experiencing.
 * -Dan

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

The topic ‘error updating settings’ is closed to new replies.

 * ![](https://ps.w.org/document-gallery/assets/icon.svg?rev=983329)
 * [Document Gallery](https://wordpress.org/plugins/document-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/document-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/document-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/document-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/document-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/document-gallery/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/error-updating-settings/#post-5111666)
 * Status: not resolved