• Resolved samuel

    (@samueljbwong)


    I added a filter function to the hook “wpforms_manage_cap” for enabling Editor role users to create new forms. It worked perfectly fine in the past. Recently, I have upgraded WPForms Lite from version 1.4.9 to 1.8.1.2. Editor role users got a blank screen when adding a new form. The following error message is found in the error log:

    PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /xxxx/xxxx/wp-content/plugins/wpforms-lite/src/Admin/Traits/FormTemplates.php:146\nStack trace:\n#0 /xxxx/xxxx/wp-content/plugins/wpforms-lite/src/Admin/Traits/FormTemplates.php(146): array_merge()\n#1 /xxxx/xxxx/wp-content/plugins/wpforms-lite/src/Admin/Traits/FormTemplates.php(71): WPForms_Builder_Panel_Setup->template_categories()\n#2 /xxxx/xxxx/wp-content/plugins/wpforms-lite/includes/admin/builder/panels/class-setup.php(88): WPForms_Builder_Panel_Setup->output_templates_content()\n#3 /xxxx/xxxx/wp-content/plugins/wpforms-lite/includes/admin/builder/panels/class-base.php(222): WPForms_Builder_Panel_Setup->panel_content()\n#4 /xxxx/xxxx/wp-includes/class-wp-hook.php(308): WPForms_Builder_Panel->panel_output()\n#5 /xxxx/xxxx/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#6 /xxxx/xxxx/wp-includes/plugin.php(517): WP_Hook->do_action()\n#7 /xxxx/xxxx/wp-content/plugins/wpforms-lite/includes/admin/builder/class-builder.php(1047): do_action()\n#8 /xxxx/xxxx/wp-includes/class-wp-hook.php(308): WPForms_Builder->output()\n#9 /xxxx/xxxx/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#10 /xxxx/xxxx/wp-includes/plugin.php(517): WP_Hook->do_action()\n#11 /xxxx/xxxx/wp-content/plugins/wpforms-lite/includes/admin/class-menu.php(326): do_action()\n#12 /xxxx/xxxx/wp-includes/class-wp-hook.php(308): WPForms_Admin_Menu->admin_page()\n#13 /xxxx/xxxx/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#14 /xxxx/xxxx/wp-includes/plugin.php(517): WP_Hook->do_action()\n#15 /xxxx/xxxx/wp-admin/admin.php(259): do_action()\n#16 {main}\n  thrown in /xxxx/xxxx/wp-content/plugins/wpforms-lite/src/Admin/Traits/FormTemplates.php on line 146, referer: https://www.xxxx.com/wp-admin/admin.php?page=wpforms-overview

    Is it a bug?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey @samueljbwong – Thanks for reaching out!

    We’re unable to provide support for issues that may cause due to code customization. That said, when you get a chance, can you please share the exact code you’re using so I can take a closer look to see if there are any issues going on here?

    Kindly,

    Thread Starter samuel

    (@samueljbwong)

    Here are codes we use:

    function wpforms_custom_capability( $cap ) {
            return 'unfiltered_html';
    }
    add_filter( 'wpforms_manage_cap', 'wpforms_custom_capability' );
    • This reply was modified 1 year, 10 months ago by samuel.

    Hey @samueljbwong – Thanks for following on this ticket, and for sharing the code.

    I looked at the code, and while I’m able to create forms in the Editor user role, I’m unable to replicate the specific error message in the log files. Further, as mentioned in my previous message, issues coming due to a custom code snippet falls outside the scope of support we can offer. In case you’d like to look into custom development options, we highly recommend using Codeable.

    Kindly,

    Thread Starter samuel

    (@samueljbwong)

    I forgot to mentioned that we had also upgrade WordPress to version 6.2. Which WordPress version did you test on?

    Thread Starter samuel

    (@samueljbwong)

    Moreover, we are currently using PHP 8.1.2. Is it the root cause of the problem?

    Hey @samueljbwong – Thanks for following on this ticket!

    I tested the snippet on the latest version of WordPress i.e. 6.2, and the PHP version 8.1.9. When you have some time, can you please try switching the PHP, or perform a plugin conflict test and see if that helps?

    Kindly,

    Hey @samueljbwong – We haven’t heard back from you since my previous message, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Got an error when Editor role users create new forms’ is closed to new replies.