Title: Coding error in event.php &#8211; I think
Last modified: April 24, 2025

---

# Coding error in event.php – I think

 *  [AndyHenderson](https://wordpress.org/support/users/andyhenderson/)
 * (@andyhenderson)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/coding-error-in-event-php-i-think/)
 * We are calculating occurrences in our UI and using eo_update_event to update 
   them in the Event Organiser database. I hate to raise an issue because I’ve used
   EO to support several charity sites with great success.
 * However, we just got the following error:
 * `[24-Apr-2025 14:45:30 UTC] PHP Fatal error: Uncaught ValueError: array_combine():
   Argument #1 ($keys) and argument #2 ($values) must have the same number of elements
   in /homepages/0/d894882115/htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/
   event-organiser/includes/event.php:381
   Stack trace:#0 /homepages/0/d894882115/
   htdocs/clickandbuilds/HaylingU3A/wp-content/plugins/event-organiser/includes/
   event.php(381): array_combine()
 * Looking at the code I see the following at lines 368 – 370:
 *   $update   = array_uintersect( $occurrences, $current_occurrences, ‘_eventorganiser_compare_dates’);
 *   $update_2 = array_uintersect( $current_occurrences, $update, ‘_eventorganiser_compare_dates’);
 *   $keys     = array_keys( $update_2 );
 * I’m struggling to understand the use of $update_2 but I think it might be trying
   to de-duplicate the occurrences. We try to avoid that in our UI but I’m not going
   to claim our code is perfect.
 * The fatal occurs because $keys doesn’t match $update. However, shouldn’t the 
   array_combine at 381 be using $update_2 and not $update? Similarly, shouldn’t
   the foreach at 383 be using $update_2 and not $update? – otherwise what’s the
   purpose of $update_2 since it’s not referenced anywhere in the code.
 * Thanks again for the plug-in,
 * Andy

Viewing 1 replies (of 1 total)

 *  [043web](https://wordpress.org/support/users/043web/)
 * (@043web)
 * [11 months ago](https://wordpress.org/support/topic/coding-error-in-event-php-i-think/#post-18553790)
 * we’re experiencing the same issue, based on the recent reviews, we’re not the
   only ones..

Viewing 1 replies (of 1 total)

The topic ‘Coding error in event.php – I think’ is closed to new replies.

 * ![](https://ps.w.org/event-organiser/assets/icon-256x256.png?rev=978123)
 * [Event Organiser](https://wordpress.org/plugins/event-organiser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-organiser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-organiser/)
 * [Active Topics](https://wordpress.org/support/plugin/event-organiser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-organiser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-organiser/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [043web](https://wordpress.org/support/users/043web/)
 * Last activity: [11 months ago](https://wordpress.org/support/topic/coding-error-in-event-php-i-think/#post-18553790)
 * Status: not resolved