• Resolved noman56

    (@noman56)


    hi, i installed the plugin, i then go to add new page “/wp-admin/post-new.php?post_type=page” and it gives this fatal php error:

    Fatal error: Uncaught TypeError: Oho\Orange\Configuration\BlockEditor::setupBlockEditorForPost(): Argument #2 ($post) must be of type WP_Post, null given, called in /wp/wp-includes/class-wp-hook.php on line 326 and defined in /app/themes/orange/src/Configuration/BlockEditor.php:197
    Stack trace:

    0 /wp/wp-includes/class-wp-hook.php(326): Oho\Orange\Configuration\BlockEditor->setupBlockEditorForPost(true, NULL)

    1 /wp/wp-includes/plugin.php(205): WP_Hook->apply_filters(true, Array)

    2 /app/plugins/press-permit-core/classes/PressShack/LibWP.php(170): apply_filters(‘use_block_edito…’, true, NULL, 9223372036854775807)

    3 /app/plugins/press-permit-core/modules/presspermit-collaboration/classes/Permissions/Collab/UI/Dashboard/DashboardFilters.php(171): PressShack\LibWP::isBlockEditorActive()

    4 /wp/wp-includes/class-wp-hook.php(324): PublishPress\Permissions\Collab\UI\Dashboard\DashboardFilters->post_edit_ui(”)

    5 /wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array)

    6 /wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

    7 /app/plugins/press-permit-core/classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php(25): do_action(‘presspermit_pos…’)

    8 /app/plugins/press-permit-core/classes/PublishPress/Permissions/UI/Dashboard/DashboardFilters.php(34): PublishPress\Permissions\UI\Dashboard\PostEdit->__construct()

    9 /app/plugins/press-permit-core/classes/PublishPress/PermissionsHooks.php(489): PublishPress\Permissions\UI\Dashboard\DashboardFilters->__construct()

    10 /app/plugins/press-permit-core/classes/PublishPress/PermissionsHooks.php(424): PublishPress\PermissionsHooks->loadInitFilters()

    11 /app/plugins/press-permit-core/classes/PublishPress/PermissionsHooks.php(264): PublishPress\PermissionsHooks->actInitUser()

    12 /wp/wp-includes/class-wp-hook.php(324): PublishPress\PermissionsHooks->actNormalInitUser(”)

    13 /wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)

    14 /wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

    15 /wp/wp-settings.php(700): do_action(‘init’)

    it works fine when edit an existing page but gives error when adding a new page, i did some debugging and found that the following code on line 165-170 in file press-permit-core/classes/PressShack/LibWP.php is causing issue:

    $conditions[] = (self::isWp5() || $pluginsState['gutenberg'])
    && ! $pluginsState['classic-editor']
    && ! $pluginsState['gutenberg-ramp']
    && ! $pluginsState['disable-gutenberg']
    && apply_filters('use_block_editor_for_post_type', true, $post_type, PHP_INT_MAX)
    && apply_filters('use_block_editor_for_post', true, get_post(self::getPostID()), PHP_INT_MAX);

    as you see while this code get_post(self::getPostID()) works for existing page, but for new page its NULL and hence the error

    Please provide a solution thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Kevin Behrens

    (@kevinb)

    @noman56 miniOrange should update their ‘use_block_editor_for_post’ filter function to bypass processing if a null post argument is passed in. We will provide a fix on our end in the next Permissions release. Until then, you can install the newly updated PublishPress Permissions development version (4.0.36-beta).

    Hi, I have a similar problem. On the back-end when I try to add a new post (wp-admin/post-new.php?post_type=notizia) I get an error: “You are not allowed to change this article”. I can’t find the problem because it won’t log any (it’s not error or fatal). The strange thing is it still creates it but with an empty argument (which I need to filter). If, as an admin, I add the correct argument, then I can modify etc as the specific user.

    I’m using WP 6.7.1, PublishPress Capabilities 2.16.0 and PublishPress Permissions 4.0.34. If I disable PublishPress Permissions it works fine… but I need it to filter through arguments. I’ve tried changing parameters on PublishPress Permissions but nothing seems to work.

    Do you have any idea why it happens or what else to try?
    Thanks in advance

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @becam Just confirming, have you tried the 4.0.36-beta version that Kevin attached in previous reply?

    Thank you for your message. Yes I have but the problem remains. Once installed though the version is Version 4.0.35-beta2 and not Version 4.0.36-beta…. Strange.

    Thanks

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @becam Thanks for confirming. We will fix this in the next release. You could also reach out to miniOrange to update their ‘use_block_editor_for_post’ filter function to bypass processing if a null post argument is passed in as Kevin suggested in the first reply.

    becam

    (@becam)

    Ok, thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.