Title: BUG array_map(): Argument #2 ($array) must be of type array
Last modified: November 26, 2024

---

# BUG array_map(): Argument #2 ($array) must be of type array

 *  Resolved [brambil](https://wordpress.org/support/users/brambil/)
 * (@brambil)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/bug-array_map-argument-2-array-must-be-of-type-array/)
 *     ```wp-block-code
       Fatal error: Uncaught Error: array_map(): Argument #2 ($array) must be of type array, null givenin /home/customer/www/staging2.jcappucci.it/public_html/wp-content/plugins/acf-galerie-4/class-acfg4-register-field-type.php on line 222
       ```
   
 * When open a post with the galerie I have this problem.
 * Suggestion: Store in the DB things in the some way of ACF Pro, to have a better
   compatibility with other plugins:
 * array ( 0 => array ( 0 => ‘5588’, 1 => ‘5597’, ), )

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

 *  Plugin Author [Navneil Naicker](https://wordpress.org/support/users/navzme/)
 * (@navzme)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/bug-array_map-argument-2-array-must-be-of-type-array/#post-18162727)
 * Hello,
 * I’m assuming the error occurs when switching the field type from “Gallery” to“
   Galerie 4” Since I don’t own ACF Pro, I’m unable to replicate the bug directly.
 * The way data is stored in the database, as done by ACF Pro, doesn’t inherently
   affect compatibility with other plugins. Compatibility depends on whether the
   other plugins implement their own action and filter hooks. Plugin developers 
   must explicitly add these hooks to ensure integration.
 * I do have an idea for fixing this issue when transitioning from “Gallery” to “
   Galerie 4” and plan to implement the fix as soon as I have access to ACF Pro.
 *  Thread Starter [brambil](https://wordpress.org/support/users/brambil/)
 * (@brambil)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/bug-array_map-argument-2-array-must-be-of-type-array/#post-18163965)
 * The problem was having both your plugin and trying to change from one to another
   mataining the old field or creating a new one while maintain also the old one.
 * I solved deleting the old one, removing all meta related to your old Gallery 
   and migrating to Galerie4.
 * I don’t have ACF Pro in this website.

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

The topic ‘BUG array_map(): Argument #2 ($array) must be of type array’ is closed
to new replies.

 * ![](https://ps.w.org/acf-galerie-4/assets/icon-128x128.jpg?rev=3337758)
 * [ACF Galerie 4](https://wordpress.org/plugins/acf-galerie-4/)
 * [Support Threads](https://wordpress.org/support/plugin/acf-galerie-4/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-galerie-4/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-galerie-4/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-galerie-4/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [brambil](https://wordpress.org/support/users/brambil/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/bug-array_map-argument-2-array-must-be-of-type-array/#post-18163965)
 * Status: resolved