Title: Bug in package.module.nextgen_data.php &#8211; Illegal string offset &#8216;saved&#8217;
Last modified: November 15, 2016

---

# Bug in package.module.nextgen_data.php – Illegal string offset ‘saved’

 *  Resolved [gjsmith66](https://wordpress.org/support/users/gjsmith66/)
 * (@gjsmith66)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/)
 * PHP Warning: Illegal string offset ‘saved’ in wp-content/plugins/nextgen-gallery/
   products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.
   php on line 2607
 * On line 2607, if $meta is not an array, you cannot do $meta[‘saved’] = FALSE;
 *  function get_saved_meta($object = false)
    { $meta = $this->image->meta_data;
   if (!isset($meta[‘saved’])) { $meta[‘saved’] = FALSE; } //check if we already
   import the meta data to the database if (!is_array($meta) || $meta[‘saved’] !
   = true) { return false; }
 * I resolved by adding the following code after the start of the function.
 *  if (!is_array($meta)) {
    return false; }

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8444836)
 * [@gjsmith66](https://wordpress.org/support/users/gjsmith66/) – We’re not seeing
   this issue ourselves in testing but thanks for offering your work-around for 
   your site.
 * – Cais.
 *  [gargamil](https://wordpress.org/support/users/gargamil/)
 * (@gargamil)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8468459)
 * `
    if (!is_array($meta)) { return false; }
 * worked for me too!
    -  This reply was modified 9 years, 6 months ago by [gargamil](https://wordpress.org/support/users/gargamil/).
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8473929)
 * [@gargamil](https://wordpress.org/support/users/gargamil/) – Thanks for sharing.
 * – Cais.
 *  [samverdyck](https://wordpress.org/support/users/samverdyck/)
 * (@samverdyck)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8488338)
 * Hi, I’m having the same problem, but I’m not 100% sure where to put the “if-function”
   exactly?
    Can you help me clarify it? Thanks!
 *  Thread Starter [gjsmith66](https://wordpress.org/support/users/gjsmith66/)
 * (@gjsmith66)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8489044)
 * The beginning of the function should look like the below. This should be an easy
   fix for the author of this plugin. It seems obvious that $meta can NOT be an 
   array at times, as they check for that later after trying to set $meta[‘saved’],
   although I could be missing something…
 * function get_saved_meta($object = false)
    {
 * $meta = $this->image->meta_data;
 * // Add here…
    if (!is_array($meta)) { return false; }
 * if (!isset($meta[‘saved’])) {
    $meta[‘saved’] = FALSE; } //check if we already
   import the meta data to the database if (!is_array($meta) || $meta[‘saved’] !
   = true) { return false; }
 *  [samverdyck](https://wordpress.org/support/users/samverdyck/)
 * (@samverdyck)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8489263)
 * Thanks for the answer!
    I edited the code like in your example, but I still get
   the http error 500 if want to edit a page or post through the adminpanel… After
   editing the code it worked once when I openend a page in the backend, but when
   I tried to save the page the error was back and now it is also back when I try
   to open a page.. Thougt maybe something with cache, but I cleared everything 
   and tried in different browsers…
 * Strange scenario..
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8489380)
 * [@samverdyck](https://wordpress.org/support/users/samverdyck/) – Please start
   your own topic so we can try to help you with your specific issue on your specific
   site.
 * See [http://codex.wordpress.org/Forum_Welcome#Where_To_Post](http://codex.wordpress.org/Forum_Welcome#Where_To_Post)
 * Thanks!
 * – Cais.
 *  [elper](https://wordpress.org/support/users/elper/)
 * (@elper)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8600663)
 * Is the original post about the same problem as
    [https://wordpress.org/support/topic/nextgen-photocrati-warning-illegal-string-offset-saved-in](https://wordpress.org/support/topic/nextgen-photocrati-warning-illegal-string-offset-saved-in)?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8601110)
 * [@elper](https://wordpress.org/support/users/elper/) – Although very similar,
   it appears the additional detail of using “BMo Expo” might be relevant in that
   topic.
 * Thanks!
 * – Cais.
 *  Thread Starter [gjsmith66](https://wordpress.org/support/users/gjsmith66/)
 * (@gjsmith66)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8782381)
 * This issue has remained for the last several versions. If folks do not want their
   log files filling up with warnings, they need to manually add this code. Author,
   can you please add this fix to the codebase? It is clear that there is a scenario
   in which $meta is not an array, you don’t test for it, and then try to access
   $meta[‘saved’], which is what causes the warning message.
 * Pretty please?
 * function get_saved_meta($object = false)
    {
 * $meta = $this->image->meta_data;
 * // Add here…
    if (!is_array($meta)) { return false; }
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8790650)
 * [@gjsmith66](https://wordpress.org/support/users/gjsmith66/) – We appreciate 
   there is a scenario where this issue is occurring and that you have shared a 
   work-around for it, we still are not able to create the scenario where this will
   happen and as such although the suggested work-around may correct this we are
   still looking at why it is happening and what would be the root of the issue.
 * I’m not seeing a matching Bug Report ([https://imagely.com/report-bug/](https://imagely.com/report-bug/))
   in our system for this issue, which may still be of assistance for the extra 
   details we may be able to get via our system although I have made note to our
   developers you are still seeing this issue with the current release of NextGEN
   Gallery.
 * Thanks!
 * – Cais.

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

The topic ‘Bug in package.module.nextgen_data.php – Illegal string offset ‘saved’’
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/)

 * 11 replies
 * 5 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/bug-in-package-module-nextgen_data-php-illegal-string-offset-saved/#post-8790650)
 * Status: resolved