• Resolved Andrew Rothman

    (@arothman)


    When I save my custom menu settings, I get a string of these:

    Notice: Undefined index: menu-item-cpcm-item-count in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 366

    Notice: Undefined index: menu-item-cpcm-item-skip in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 367

    Notice: Undefined index: menu-item-cpcm-item-count in C:\inetpub\sites\wisbase\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 366

    Notice: Undefined index: menu-item-cpcm-item-skip in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 367

    Notice: Undefined index: menu-item-cpcm-item-count in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 366

    Notice: Undefined index: menu-item-cpcm-item-skip in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 367

    Notice: Undefined index: menu-item-cpcm-item-count in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 366

    Notice: Undefined index: menu-item-cpcm-item-skip in C:\inetpub\site\wp-content\plugins\category-posts-in-custom-menu\category-posts-in-custom-menu.php on line 367

    It doesn’t appear to affect function, but I was wondering if I should be concerned or if something needs to be altered?

    https://www.ads-software.com/plugins/category-posts-in-custom-menu/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi,

    thanks for your message. I’m sorry to hear you’re getting errors.

    Would you be able to narrow down which of the CPCM menu items causes this? Have you manually set values for count or skip?

    Kind regards,
    Diana

    Thread Starter Andrew Rothman

    (@arothman)

    Hi Diana,

    The error appears when I click “Save Menu” on any menu. I don’t believe manual values for count or skip have been set, but I’m not sure – where would I look?

    Hi,

    I’m afraid I haven’t had this error before and cannot reproduce it so far.
    Since the same two errors occur 4 times, there could be up to 4 menu items that have the same issue.

    To check the count and skip values, please review your settings for “Number of Posts” and “Skip Posts” for every item that has “Create submenu containing links to posts in this category.” checked. Do all of them have valid numeric values?

    Since when are you experiencing this issue?
    Are you using other plugins and could you disable them one by one to see if the issue persists? (Unlikely but possible nonetheless)

    I hope I can help you help me narrow it down.. Thank you for your swift reply.

    Kind regards,
    Diana

    Ah, found it!
    The reason you are seeing this error and I am not, is because you probably have

    define(‘WP_DEBUG’, true);

    defined in wp-config.php
    Set it to false to suppress this warning.

    In the meantime, I’m obviously going to work to fix this.
    Thank you for reporting!

    Kind regards,
    Diana

    (Will be fixed in next release. Unfortunately this was too late for 1.1, will bring out 1.1.1 at a later time probably.)

    Thread Starter Andrew Rothman

    (@arothman)

    Ah! I very likely do have the debugger enabled. Glad to help with the reporting and I’ll keep an eye out for the update whenever it should come.

    Thanks for the great plugin!

    I am also getting this notice (with debug enabled)…

    Undefined index: menu-item-cpcm-item-count in …wp-content/plugins/category-posts-in-custom-menu/category-posts-in-custom-menu.php on line 531
    Undefined index: menu-item-cpcm-item-skip in …wp-content/plugins/category-posts-in-custom-menu/category-posts-in-custom-menu.php on line 532

    I have version 1.2.0 on WordPress 4.2.2

    Hi John,

    I’m sorry you’re experiencing this, I thought I had tackled this. I will look into it ASAP.

    Kind regards,
    Diana

    Hi Diana,
    I also get the error messages John sees. If it helps: I have the plugin “Ubermenu” (https://wpmegamenu.com/) installed. But I get the errors on all menus, even on menus where Ubermenu isn’t active.

    Hope that helps!
    Thank you

    Hi John and tyarnn0us,

    thank you for your messages. I’m afraid in my test environment I don’t see this problem at all. I’m guessing there’s some default parameter that isn’t being set properly, but at first glance I don’t see where the problem is.

    Which actions are you performing when you see this error? Editing the menu or viewing the website? (Both?)

    Kind regards,
    Diana

    Hi Diana,
    sorry for getting back to you so late.
    I get the following errors in the backend (https://xyz/wp-admin/nav-menus.php?action=edit&menu=xy):
    Notice: Undefined offset: 2935 in /var/www/vhosts/xyz/httpdocs/wp-content/plugins/category-posts-in-custom-menu/category-posts-in-custom-menu.php on line 531
    Notice: Undefined offset: 2935 in /var/www/vhosts/xyz/httpdocs/wp-content/plugins/category-posts-in-custom-menu/category-posts-in-custom-menu.php on line 532

    This happens when I save the menu even if I haven’t changed any settings.

    Hi tyrann0us,

    thank you for getting back to me on this. I can’t explain yet why this happens.

    What I can tell you is that it pertains to the ‘count’ and ‘skip’ parameters of a specific menu item. To be exact, menu item 2935 somehow does not receive a ‘count’ or ‘skip’ parameter when you save the menu.

    Are you by any chance able to identify which menu item is 2935 and what the count and skip parameters are? (Identifying this ID is not always possible, but if you are comfortable with inspecting HTML/CSS, if the menu item is still present in the menu it should have <li id=”menu-item-2935″ in HTML.) Another way would be to inspect the ‘count’ and ‘skip’ parameters manually in Appearances > Menus. These should not be letters or special symbols, only digits are allowed.

    Anyway, I will look into it again next weekend. Now that I know it should be seen in the backend when saving the menu, I hope I can reproduce this.

    My apologies for this issue and my slow responses and thank you for getting back to me on this!

    Kind regards,
    Diana

    Hi Diana,
    thanks for getting back to me!

    The menu in question consists out of several menu item like this:

    Page
    	Page
    	Page
    	Page
    	...
    Custom Taxonomy
    	Custom Taxonomy
    	Custom Taxonomy
    	...
    	Page
    	Page
    Custom Taxonomy
    	Custom Taxonomy
    	Custom Taxonomy
    	...
    	Page
    	Page
    Page
    	Page
    	Page
    Page
    	Page
    	Page

    If that matters: I have the checkbox “Create submenu containing links to posts in this taxonomy.” checked for all “Custom Taxonomy” items.

    Here’s what I see: For each “page” menu item I will get a PHP notice (my menu has 23 pages -> 46 PHP notices). The IDs also match the “page” menu item IDs.
    Since I get the notices only for pages there are no “count” and “skip” parameters I can inspect.

    Hope this helps!
    tyrann0us

    tyrann0us,

    brilliant, I reproduced it thanks to your description. I’m on it ??

    Kind regards,
    Diana

    I think I’ve fixed it.

    Is someone willing to try out the development version? It can be found on the Developers tab page under ‘Other Versions’

    Kind regards,
    Diana

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Undefined Index?’ is closed to new replies.