WordPress.org

Forums

Event Organiser
[resolved] Getting Invalid argument AJAX stuck loading full calendar (9 posts)

  1. Jose
    Member
    Posted 2 years ago #

    <br />
    <b>Warning</b>:  Invalid argument supplied for foreach() in <b>/homepages/12/d207939151/htdocs/wp-admin/includes/plugin.php</b> on line <b>1290</b><br />
    []

    That's the error I got from the console, here is the site, though it seems to work in Chrome but it gets stuck loading in FireFox, Safari, and IE. The weird thing though is it works on our development server and it's mostly a mere image of each other. I did create a few more files on the live site but that's for the members section.

    If you can help out I would appreciate it.

    Thanks.

    http://wordpress.org/extend/plugins/event-organiser/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 2 years ago #

    Did some digging (assuming at least you're using WP3.5) that error corresponds to a line in this function (https://github.com/WordPress/WordPress/blob/3.5/wp-admin/includes/plugin.php#L1279) (remove_menu_page()).

    It seems that the global $menu is not an array - which suggests something has corrupted it.

    Event Organiser doesn't invoke that function anywhere, nor does it touch global $menu - so I can only assume there's a plug-in you have active on one and not the other. Else, may have WP's core files been changed?

  3. Jose
    Member
    Posted 2 years ago #

    I will check the other plugins I have. It's funny how I have the same plugins that's on the development server and the live site but works on our development server.

    I'll keep you posted. Thanks.

  4. Jose
    Member
    Posted 2 years ago #


  5. Jose
    Member
    Posted 2 years ago #

    Found out the calendar loads fine when logged in as admin. But to the user it gets stuck loading. Any ideas as to what it can be? I had this user plugin called "Peter's Login Redirect" and I deactivated to see if that was the problem but it wasn't. So now I'm stuck.

  6. Jose
    Member
    Posted 2 years ago #

    All the plugins are disabled - http://fbmg.mmidevsite2.com/events/calendar/

  7. Stephen Harris
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jose, I'm getting this error message:

    <b>Notice</b>: Use of undefined constant IS_PROFILE_PAGE - assumed 'IS_PROFILE_PAGE' in <b>..../content/wp-content/themes/main FBMG/functions.php</b> on line <b>299</b>

    <b>Warning</b>: Invalid argument supplied for foreach() in <b>...content/wp-admin/includes/plugin.php</b> on line <b>1290</b>

    Seems (the first notice at least) is a but with your theme? It could be the theme causing the second error two - try switching to TwentyEleven?

  8. Jose
    Member
    Posted 2 years ago #

    That worked. How were you able to pull that info? I removed the code that was referring to line 299 which was to keep other users, subscribers, from editing their profile in the admin panel

    // ===== remove edit profile link from admin bar and side menu and kill profile page if not an admin
    if( !current_user_can('activate_plugins') ) {
    function mytheme_admin_bar_render() {
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu('edit-profile', 'user-actions');
    }
    add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
    
    function stop_access_profile() {
        if(IS_PROFILE_PAGE === true) {
            wp_die( 'Please contact your administrator to have your profile information changed.' );
        }
        remove_menu_page( 'profile.php' );
        remove_submenu_page( 'users.php', 'profile.php' );
    }
    add_action( 'admin_init', 'stop_access_profile' );
    }

    I'm sure I can find a work around on this. Thanks a bunch man!

  9. Stephen Harris
    Member
    Plugin Author

    Posted 2 years ago #

    I just viewed the ajax response in my browser console (Network tab on Chrome, refresh page, look for admin-ajax.php - usually near the bottom).

    Try

    if( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE === true) {

    Instead.

    The code,

    remove_menu_page( 'profile.php' );
        remove_submenu_page( 'users.php', 'profile.php' );

    Explains the original error too. I think admin_init is the wrong hook for that. Try admin_menu instead?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Event Organiser
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic