Title: Error &quot;Warning: in_array() expects parameter 2 to be array, null given in&#8230;&quot;
Last modified: August 31, 2016

---

# Error "Warning: in_array() expects parameter 2 to be array, null given in…"

 *  Resolved [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/)
 * When I put a “NextGEN Basic Compact Album” with IGW (green button) on a fresh
   page, click on an album and then click on a gallery inside that album, I get 
   the following error:
    “Warning: in_array() expects parameter 2 to be array, null
   given in…”
 * Please check sample here:
 * [http://www.bremer-schweiz.de/test-gallery](http://www.bremer-schweiz.de/test-gallery)
 * click on “Bremer Schweiz allgemein” and then on “Karten”.
 * What can I do?

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990725)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – Are you using 
   any sort of custom sort order for the albums? Our next release does have a minor
   modification related to sorting but I do not believe it will be specifically 
   linked to this issue.
 * Also, there could be a plugin conflict going on here or at least it should be
   ruled out. Have you tried deactivating all of your plugins, clearing your browser
   cache (and site caches if you are using a caching plugin), then reactivating 
   the NextGEN plugin?
 * If this fixes the problem then it was likely one of the deactivated plugins that
   was causing an issue. Now, retrace your steps activating each plugin and re-checking
   to see if the problem returns. If it does then that last activated plugin was
   probably the one. Keep reactivating and in most cases it is also best to keep
   checking after each plugin, sometimes there may be more than one plugin on a 
   site that will create an issue. If you do find one (or more) plugins causing 
   this problem we would greatly appreciate your feedback on them so the developers
   may address them as soon as they can.
 * Also to note, in rare cases it may be the theme itself that is causing a conflict
   so while you have just the NextGEN plugin activated you might consider temporarily
   switching to one of the default WordPress Twenty series themes and see if this
   corrects the issue as well.
 * If the problem still persists after all of this we would still want to know, 
   even more so, as we will still want to sort out the issue and may need additional
   details.
 * Thanks!
 * – Cais.
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990728)
 * Hi Cais,
 * I deactivated all plugins, cleared browswer cache and activated only NextGen:
   Same errors!
 * I tried with IE instead of Firefox: Same errors!
 * I also switched to theme twenty sixteen: Same errors!
 * I googled that many other users had the same error with NextGen for mseveral 
   years already: You still don’t have a clue why?
 * Brgds.
    Steffen
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990783)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – We’re not able
   to reproduce this issue ourselves so we do not know why it is happening on some
   sites. Please send us a Bug Report ([http://nextgen-gallery.com/report-bug/](http://nextgen-gallery.com/report-bug/)…
   please reference this topic) so we can get a better look under the page at your
   site.
 * Please include as many details as you can about your site and the issue at hand
   so we can move on this as fast as possible.
 * Thanks!
 * – Cais.
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990784)
 * can you see it on the sample page I created for you, at least?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990785)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – Yes, I can see
   the issue on your site; I’m not disputing in any way that you are experiencing
   a problem but as it is I cannot tell why that is the case.
 * – Cais.
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990786)
 * I realized that the gallery preview images, stored in the “dynamic” subfolder,
   are files with extremely long names, such as “Radtour-2003-1.JPG-nggid03537-ngg0dyn-
   220x220x100-00f0w010c011r110f110r010t010.JPG”
 * Could it be that this has something to do with the problem?
 * It does cause a problem with some Backup Plugins (e.g. BackWPup) that fail to
   pack theses files in a tar archive as the filename is too long.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990803)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – Although in some
   cases some back-up plugin run into trouble with long file paths I do not see 
   this being the case with this operation here.
 * – Cais.
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990809)
 * Could it be a memory limitation?
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990826)
 * … my server’s max_execution_time is 30 and memory_limit is 96M.
 * Could that cause the error?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990832)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – Have you tried
   raising those limits?
 * – Cais.
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990833)
 * I would if I could but that would imply an expensive upgrade of our webiste packet.
 * Could you on the contrary reduce your limits accordingly and check if this causes
   the error?
 * – Steffen
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990834)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – The limits if 
   they are being crossed on your site could very well be due to something very 
   specific to your site. We have many sites that work fine with lower limits (although
   we do not recommend operating with limits that low).
 * – Cais.
 *  Thread Starter [stewagner](https://wordpress.org/support/users/stewagner/)
 * (@stewagner)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990864)
 * I post again the complete 4 error messages as this matter is still unsolved:
 * “Warning: in_array() expects parameter 2 to be array, null given in /var/www/
   web1246/html/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/
   nextgen_basic_album/package.module.nextgen_basic_album.php on line 76
 * Warning: Invalid argument supplied for foreach() in /var/www/web1246/html/wp-
   content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/
   package.module.nextgen_basic_album.php on line 70
 * Warning: in_array() expects parameter 2 to be array, null given in /var/www/web1246/
   html/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/
   package.module.nextgen_basic_album.php on line 76
 * Warning: Invalid argument supplied for foreach() in /var/www/web1246/html/wp-
   content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/
   package.module.nextgen_basic_album.php on line 70″
 * I can see that lots of other users have the same problem:
    [https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-to-be-array-null-given-in?replies=6](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-to-be-array-null-given-in?replies=6)
   [https://wordpress.org/support/topic/nextgen-update-20-problems?replies=15](https://wordpress.org/support/topic/nextgen-update-20-problems?replies=15)
   [https://wordpress.org/support/topic/php-error-nextgen-gallery-v2-ad-bbpress?replies=7](https://wordpress.org/support/topic/php-error-nextgen-gallery-v2-ad-bbpress?replies=7)
   [https://wordpress.org/support/topic/nextgen-gallery-error-on-lines-657-and-652-653?replies=6](https://wordpress.org/support/topic/nextgen-gallery-error-on-lines-657-and-652-653?replies=6)
   [https://wordpress.org/support/topic/php-error-when-displaying-the-images?replies=10](https://wordpress.org/support/topic/php-error-when-displaying-the-images?replies=10)
 * … with even more users still dropping into the thread with the same error. Unfortunately,
   even though these errors are sometimes more then a year old, you could not offer
   real solution to the problem, which is sad and unacceptable.
 * Bbpress which is mentioned as a possible conflict plugin is installed but deactivated.
 * Please check the lines mentioned in the error codes and come up with some code
   changes that hopefully solve the problem.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990865)
 * [@stewagner](https://wordpress.org/support/users/stewagner/) – There is no generic
   solution to this issue because it is not a general issue across all sites. The
   problem does occur on some sites, and in some cases it has been resolved and 
   in others it has not.
 * We are more than happy to look at your site specifically if you would care to
   send us the Bug Report I suggested earlier.
 * Thanks!
 * – Cais.

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

The topic ‘Error "Warning: in_array() expects parameter 2 to be array, null given
in…"’ 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/)

 * 14 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in/#post-6990865)
 * Status: resolved