• Resolved annaam

    (@annaam)


    Hello,

    Problem:

    • When viewing a different plugins tab, “Ultimate Dashboard” => “Admin Menu Editor” tab, the following PHP warnings from this plugin appear in the debug logs:

    [25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key “toplevel” in /sites/WEBSITE/files/wp-content/plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php on line 454

    [25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key “menu_title” in /sites/WEBSITE/files/wp-content/plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php on line 458

    [25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key “capability” in /sites/WEBSITE/files/wp-content/plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php on line 459

    Steps to Reproduce:

    1. Install Posts 2 Posts
    2. Install Ultimate Dashboard
    3. Navigate to wp-admin => ultimate dashboard => admin menu editor
    4. Observe PHP warnings in log

    Observations:

    1. These warnings only occur on that one page.
    2. The page is functional.
    3. They appear to result from SCB framework expecting certain array keys (toplevel, menu_title, capability) that the plugin, Ultimate Dashboard, does not provide when instantiating AdminPage objects on this tab.
    4. These warnings are non-fatal and do not affect site operation.
    5. This seems to be an integration edge case.
    6. When did this start? Not sure, unfortunately. We don’t use this tab and only found the error from testing a new update for Ultimate Dashboard.

    Environment Details:

    1. PHP 8.3
    2. WordPress v6.9.1
    3. Posts 2 Posts v1.7.6
    4. Ultimate Dashboard v3.8.13

    I’ve also reported this with Ultimate Dashboard. I couldn’t decide which plugin to notify, so I notified both. If you believe this is solely an Ultimate Dashboard issue, please let me know and I will continue with them.

    Thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter annaam

    (@annaam)

    Response from Ultimate Dashboard:

    We looked into this and concluded that this is an issue with the Posts 2 Posts plugin.

    The culprit is init_args() in posts-to-posts/admin/tools-page.php#L17
    It uses a raw array assignment instead of merging, so it wipes out all the defaults that check_args() had populated in posts-to-posts/vendor/scribu/scb-framework/AdminPage.php#L508

    Fix suggested for “Posts 2 Posts” plugin:

    The fix belongs in P2P_Tools_Page::init_args() – it should use wp_parse_args() to merge onto existing args instead of replacing them.

    This:

    function init_args() {	$this->args = array(		'page_title' => __( 'Connection Types', P2P_TEXTDOMAIN ),		'page_slug' => 'connection-types',		'parent' => 'tools.php'	);}

    Should become this:

    function init_args() {	$this->args = wp_parse_args( array(		'page_title' => __( 'Connection Types', P2P_TEXTDOMAIN ),		'page_slug'  => 'connection-types',		'parent'     => 'tools.php',	), $this->args );}

    This preserves all the defaults from check_args() while still allowing init_args() to update the translated page_title.

    Plugin Author Stiofan

    (@stiofansisland)

    This issue has been fixed and will be release in the enxt update: https://github.com/AyeCode/wp-posts-to-posts/pull/22/changes/0c635e8499abb3ce9135b37cd0fd00e7a438b5c8

    Thanks,

    Stiofan

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

You must be logged in to reply to this topic.