• ResolvedPlugin Contributor WebMan Design | Oliver Juhas

    (@webmandesign)


    Hello,

    I’ve noticed this PHP warning in my server error log:

    PHP Warning:
    Attempt to read property "ID" on null
    in ./wp-content/plugins/beaver-builder-lite-version/classes/class-fl-builder-ui-settings-forms.php
    on line 92

    I haven’t been able to determine the specific page layout/logic that triggers this PHP warning, but I was able to fix it by adding FLBuilderModel::is_builder_active() check at the beginning of FLBuilderUISettingsForms::enqueue_settings_config() method.

    So, basically, I’ve changed the method from:

    	/**
    * Adds an inline script for general settings config and
    * one for module settings config.
    *
    * @since 2.0.7
    * @return void
    */
    static public function enqueue_settings_config() {
    global $wp_the_query;
    global $post;
    ...

    to:

    	/**
    * Adds an inline script for general settings config and
    * one for module settings config.
    *
    * @since 2.0.7
    * @return void
    */
    static public function enqueue_settings_config() {

    if ( ! FLBuilderModel::is_builder_active() ) {
    return;
    }

    global $wp_the_query;
    global $post;
    ...

    This fixed the issue for me.

    Please consider adding this check in the next plugin update. Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Jamie

    (@codente)

    We’re actually not able to include the code change you used as that would prevent Module Blocks from working since that check will always be false in the Block Editor.

    From what we can tell of the error, it looks like you’d have to be using the block editor on something that does not have a post ID to trigger the error.

    Plugin Contributor WebMan Design | Oliver Juhas

    (@webmandesign)

    Hi Jamie,

    Yes, it seems on some pages the post ID is not provided. I actually got this error on an archive page where I was testing!

    Anyway, the code I’ve provided seems to be working because FLBuilderModel::is_builder_active() method actually contains better post_id setup/checks.

    So, if you could check for empty post_id instead, that would also resolve the issue I think.

    Plugin Contributor Jamie

    (@codente)

    Were you editing an archive with the block editor at the time so using Full Site Editing?

    Were you using any module blocks?

    • This reply was modified 5 months, 3 weeks ago by Jamie.
    Plugin Contributor WebMan Design | Oliver Juhas

    (@webmandesign)

    Jamie, thank you for help and I’m really sorry for taking your time. I’ve traced the issue to the theme code, not the Beaver Builder plugin. Consider this issue as resolved.

    Thank you again!

    Plugin Contributor Jamie

    (@codente)

    Hey Oliver,

    No worries at all but thanks for taking the time to let us know you found what it was related to. Hope you have a great weekend!

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.