WordPress.org

Ready to get started?Download WordPress

Forums

Restrict Categories
[resolved] Warning: (17 posts)

  1. yoramzara
    Member
    Posted 1 year ago #

    This is the message I got when I upgraded the plugin now

    Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /home/avelim2/public_html/wp-content/plugins/restrict-categories/restrict-categories.php on line 442

    Warning: array_values() expects parameter 1 to be array, null given in

    What is this?

    http://wordpress.org/extend/plugins/restrict-categories/

  2. RyanThaDude
    Member
    Posted 1 year ago #

    I'm getting it too, and it's causing problems while posting articles due to "Headers already sent".

  3. saintandrews
    Member
    Posted 1 year ago #

    Same here. Reverted until fixed.

  4. Contemplative Computing
    Member
    Posted 1 year ago #

    Same here.

  5. Contemplative Computing
    Member
    Posted 1 year ago #

    I commented out the problem clause and everything seems to be working okay for now. Will look out for an update.

  6. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    What PHP version are you using and in what scenarios can this be reproduced?

    I tried this on PHP 5.2.17 and 5.3.5 and could not get this error. I went through and saved categories for Roles and Users, checked the Posts screen, added a Post, reset the settings. Am I missing something?

  7. yoramzara
    Member
    Posted 1 year ago #

    5.3.8

  8. RyanThaDude
    Member
    Posted 1 year ago #

    My host is using 5.3.15 and my local Ubuntu test server is using 5.4.6. The error would only appear in /wp-admin. I also reverted back on my production server and the error went away.

    EDIT: I just tested it on my test server and the warning appears at the top of every page in /wp-admin. Making any changes causes "Headers already sent" and the page fails to load.

  9. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    You can try replacing line 441 with the following and see if the error goes away:
    if ( is_array( $settings_user ) && array_key_exists( $user_login . '_user_cats', $settings_user ) )

  10. yoramzara
    Member
    Posted 1 year ago #

    I am sot a coder. It is easier for me to stay with 2.5 that has no issues.

  11. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    I understand. It's just a single line, though and you'd be helping out others with similar problems.

    If someone else wants to test this, I'd appreciate it.

  12. danicasati
    Member
    Posted 1 year ago #

    Same problem.
    I get this warning everywhere on my control panel.

  13. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    @danicasati, what PHP version are you running? If you can try replacing line 441 with the above code to see if that works, that'd help.

  14. danicasati
    Member
    Posted 1 year ago #

    Yes, it works.
    Could you patch this issue in next version?

  15. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    Cool, will do. Thanks for testing!

  16. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 1 year ago #

    The fix has been integrated in 2.6.1, so give that a try and let me know if it doesn't work.

  17. RyanThaDude
    Member
    Posted 1 year ago #

    No errors or warnings on the 2.6.1 update. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.