WordPress.org

Forums

Ninja Forms
[resolved] PHP error in sidebar.php (10 posts)

  1. stephen h
    Member
    Posted 4 years ago #

    When I use Ninja Forms lite in WP 3.3.1 in multi-site/network mode, by going to the Add a New Form page (at siteurl.com/wp-admin/admin.php?page=ninja-custom-forms&ninja_form_id=new) I get the following PHP error message:

    Warning: Invalid argument supplied for foreach() in /home/companyh/public_html/demo/wp-content/plugins/ninja-forms/includes/sidebar.php on line 52

    If it helps, it's not the main site in the WP installation, it's a sub-site, and this error does occur even with all other plugins deactivated.

    http://wordpress.org/extend/plugins/ninja-forms/

  2. Kevin Stover
    The WP Ninjas
    Plugin Author

    Posted 4 years ago #

    Hey Stephen,

    There's a known bug with multi-site activation. I will attempt to setup a network environment this week and try to squash it. If you are able to activate Ninja Forms on a site basis, it should work that way for the time being.

    Sorry for any inconvenience.

  3. workshed
    Member
    Posted 4 years ago #

    I had this happen on a non-multisite install and managed to find a workaround. The quick patch was to grab the referenced array from line 239 of ninja_forms.php and paste it above the foreach() loop on line 192 of sidebar.php. Here is the array that needs to be pasted:

    $fields_sidebar_order = array('custom-fields', 'defined-fields', 'layout-elements', 'multi-part', 'post-elements');

    Seems to do the trick until there's a patch.

  4. workshed
    Member
    Posted 4 years ago #

    On second thought, it seems as though there is something else going on... I am now seeing a few other arrays that are not able to be referenced from sidebar.php. I have all three of these in place at the top of sidebar.php now and it looks like the PHP errors have stopped. I did recently move my site to a different server, so I'm not sure if that has anything to do with it, but here are the lines I added in case this helps anyone:

    $fields_sidebar_order = array('custom-fields', 'defined-fields', 'layout-elements', 'multi-part', 'post-elements');
    $settings_sidebar_order = array('subs-settings', 'append-page-settings', 'append-post-settings');
    $subs_sidebar_order = array('export-subs', 'manage-subs');

  5. Kevin Stover
    The WP Ninjas
    Plugin Author

    Posted 4 years ago #

    Hey guys,

    I'm away from my computer for the rest of the day, but I'm hoping to get an update out tomorrow that will take care of this issue. It has to do with the way ninja forms tries to save the sidebar order on its respective pages. Thanks for the workaround, but it should be taken care of tomorrow.

  6. Kevin Stover
    The WP Ninjas
    Plugin Author

    Posted 4 years ago #

    Version 1.3 should take care of this error. If you have upgraded to version 1.3 or higher and are still having it, please let me know by starting a new thread, thanks!

  7. gr33nman
    Member
    Posted 4 years ago #

    This is still an issue.
    Actually, this is not even with the sidebar, but
    just adding it to the bottom of a page.
    The error shows on every page - even those that don't have a ninja form.
    Ninja Forms Lite 1.3.4
    Wordpress 3.3.1

    Warning: session_start() [function.session-start]: open(/tmp/sess_298e8fcf20cc35e1ce80706c4ea6994b, O_RDWR) failed: Permission denied (13) in /home/user/website.org/wp-content/plugins/ninja-forms/ninja_forms.php on line 56
    
    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/user/website.org/wp-content/plugins/ninja-forms/ninja_forms.php:56) in /home/user/website.org/wp-content/plugins/ninja-forms/ninja_forms.php on line 56
  8. Kevin Stover
    The WP Ninjas
    Plugin Author

    Posted 4 years ago #

    Hey,

    Yeah, that session error isn't what was going on in the sidebar. It looks like something completely different. I haven't seen it before, but I'll check my dev site and see if I can reproduce it. Could you do me a favour and deactivate other plugins that you have active, so that we can make sure it's not a plugin conflict?

  9. Kevin Stover
    The WP Ninjas
    Plugin Author

    Posted 4 years ago #

    Just doing a quick Google search, the most interesting part of that error is the failed: Permission denied (13). If you don't mind editing code, there's a possible solution on the php session_start() manual page, down in the comments section.

    http://php.net/manual/en/function.session-start.php

    I'll keep digging and see if I can come up with something else.

  10. gr33nman
    Member
    Posted 4 years ago #

    Kevin,

    Thanks for your reply. I found out the problem. The raid had to be restored. Unknown to me, the files were old, while the mysql database was much newer. I simply replaced the old files with a newer set of backup files and now things are working correctly.

    I'm sorry if I have put you through any extra work. Ninja Forms Lite is again working correctly.

    Again thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ninja Forms
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic