JavaScript errors, Page Builder stopped working in nested pages

Hello,

It seems as though Page Builder has stopped working on my site. Looks like there is a JavaScript error (Uncaught TypeError: Cannot read property ‘row’ of undefined) that is preventing normal behavior. I think the issue lies in the way the site’s sidebar is displayed. The persistent sidebar (a Page Builder page) is displayed next to main content, also a Page Builder page. I am doing this by querying the page inside the sidebar template file:

<?php $recent = new WP_Query("pagename=sidebar"); while($recent->have_posts()) : $recent->the_post();?>
           <?php the_content(); ?>
    <?php endwhile; ?>

As you may remember, you had created a global filter in order for this to work properly. Well, something changed or updated and now Page Builder does not work unless I take the page query out, which then of course removes the sidebar from the site.

Any thoughts on how to resolve this? Email me directly for log in credentials, if needed.

Thanks,
Dimitry

Hey Dimitry,

Sorry about this issue. Can you email me your login info so I can take a look? Justin [at] fastlinemedia [dot] com. Thanks!

Justin

Sometime all you need is to write down a problem, to be able to solve it :slight_smile:

Since Page Builder is for logged in users (admins) only anyway, I can not run the sidebar query for logged in users:

<?php if (!is_user_logged_in() ) { ?>
	<?php $recent = new WP_Query("pagename=sidebar"); while($recent->have_posts()) : $recent->the_post();?>
           <?php the_content(); ?>
    <?php endwhile; ?>
		<?php } ?>

This also helps alleviate any confusion when editing pages by not displaying the sidebar, which is not being edited anyway. Problem solved.

Thanks,
Dimitry

Nice work! That logic will definitely come in handy for others trying to nest a layout in a sidebar. Let me know if you run into anything else.

Justin