• Hi, i have this problem Cannot add element to the array as the next element is already occupied
    when i activate the plugin, the debugger stop at this point of the code: plugin.php:1416, i have the last version. Have php 8.0.30, WordPress 6.6

    if ( null === $position || ! is_numeric( $position ) ) { $menu[] = $new_menu; }
    • This topic was modified 1 month, 4 weeks ago by jumptech.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support alexisbienayme

    (@alexisbienayme)

    Hi,

    To ensure that there is not a conflict issue with another plugin, I would recommend trying to disable every plugins on a staging website, and enable them one by one until the issue comes back, which will help you to identify the faulty plugin.

    Best Regards,

    Alexis

    Plugin Support enzonewman

    (@enzosendinblue)

    Hello, I want to add something to the previous message.

    This code checks if $position is null or not a number. If so, it appends ($menu[] = $new_menu;) the new item to the array $menu.
    Error Cause:

    The error “Cannot add element to the array as the next element is already occupied” could be caused if you’re or another plugin trying to insert into an indexed array but the index you’re trying to use already exists or there’s an issue with $position.

    Follow the step suggested in the first message. If the error persists, I recommend checking the full stack trace or logs for any additional details.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.