Skip to content

Unique Post System usage resulting in error in SiteOrigin Page Builder #95

@AlexGStapleton

Description

@AlexGStapleton

The Unique Post System setting will result in a fatal error message when a widget that uses it is added using SiteOrigin Page Builder.

Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /home/***/public_html/wp-content/themes/colormag-pro/inc/template-tags.php:167 Stack trace: #0 /home/***/public_html/wp-content/themes/colormag-pro/inc/template-tags.php(167): array_merge() #1 /home/***/public_html/wp-content/themes/colormag-pro/inc/widgets/colormag-featured-posts-slider-widget.php(171): colormag_append_excluded_duplicate_posts() #2 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/renderer.php(717): colormag_featured_posts_slider_widget->widget() #3 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/renderer.php(1059): SiteOrigin_Panels_Renderer->the_widget() #4 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/renderer.php(1024): SiteOrigin_Panels_Renderer->render_widget() #5 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/renderer.php(936): SiteOrigin_Panels_Renderer->render_cell() #6 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/renderer.php(491): SiteOrigin_Panels_Renderer->render_row() #7 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/admin.php(1095): SiteOrigin_Panels_Renderer->render() #8 /home/***/public_html/wp-content/plugins/siteorigin-panels/inc/admin.php(209): SiteOrigin_Panels_Admin->generate_panels_preview() #9 /home/***/public_html/wp-admin/includes/template.php(1395): SiteOrigin_Panels_Admin->render_meta_boxes() #10 /home/***/public_html/wp-admin/edit-form-advanced.php(711): do_meta_boxes() #11 /home/***/public_html/wp-admin/post.php(206): require('/home/***/...') #12 {main} thrown in /home/***/public_html/wp-content/themes/colormag-pro/inc/template-tags.php on line 167

This appears to be due to the $colormag_duplicate_posts not being detected correctly. Likely due to the global not being able to be passed down the chain. Storing it using query var (or something like that) may account for not only this issue but any similar type of usage. Due to how this issue could be fixed in a few different ways I haven't come up with a fix. I would be happy to come up with one and submit it to any repo, or for someone else to submit it on my behalf.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions