1 (edited by skipClicks 2016-07-24 11:31:07)

Topic: Juicebox BUG!!! Pro version 1.5.0

I am in the process of changing web hosts and have run into a major stumbling block in getting my Juicebox galleries to display.

I have deactivated all plugins. I deleted, reinstalled, and activated Juicebox Pro 1.5.0. I deleted the wp_content\uploads\juicebox folder.

I created a new post and uploaded new images. I *can* create a Wordpress gallery. However, when I try to create a Juicebox gallery using the [Add Juicebox Gallery] button, I get an error: WP-Juicebox is unable to insert a Juicebox Gallery shortcode tag.

However, the XML file is created and I can manually key in the shortcode.

Unfortunately, when I view the post, I get nothing but a big, gray box that says Juicebox Error: Config file not found.

When I view the page source, I can see find the embed code, and it looks fine:

<!--START JUICEBOX EMBED-->
<script type="text/javascript">
    var jb_1 = new juicebox({
        backgroundColor: "rgba(34,34,34,1)",
        configUrl: "http://mywebsitename.com/wp-content/plugins/wp-juicebox/config.php?gallery_id=1",
        containerId: "juicebox-container-1",
        galleryHeight: "600px",
        galleryWidth: "100%"
    });
</script>
<div id="juicebox-container-1"></div>
<!--END JUICEBOX EMBED-->

When I paste the configURL into my browser address bar, I see valid XML, including not only the gallery options, but also including all the images.

When I open the XML file in a text editor, everything looks fine.

I have successfully migrated one of my sites, but have spent the past 15 hours trying to understand why it is working on one site, but not this.

Any help would be greatly appreciated.

Re: Juicebox BUG!!! Pro version 1.5.0

UPDATE!

After another painstaking 5 hours, I have finally figured out the problem, and unfortunately, I do not have the skills to hack the juicebox code to fix this myself.

There is a bug in how juicebox resolves permalinks!

I use a custom permalink: /%category%/%postname%/

When I change this back to the permalink that the MojoMarketplace "one-click install" used ( /index.php/%year%/%monthnum%/%day%/%postname%/ ), my galleries started working!

After further testing, the problem ("bug") is that juicebox is requiring "/index.php" to be included in the permalink. This is a juicebox issue, not a Wordpress issue, as the site functions perfectly without "/index.php" being part of the permalink.

On one hand, I'm glad to at least be able to see my galleries.

On the other hand, though, this is something that juicebox should handle internally...

Re: Juicebox BUG!!! Pro version 1.5.0

It looks like certain permalink structures are causing the internal URLs used by WP-Juicebox to be rewritten (breaking the plugin).
My own tests suggest that using 'Plain' or 'Post name' permalinks works fine but using any of the others does not.

I'll investigate further and post back with my findings.

Re: Juicebox BUG!!! Pro version 1.5.0

I think I've found a solution to the problem.
Open the plugin's 'config.php', jb-config.php' and 'save-gallery.php' files in a plain text editor and change all instances of:

include_once $wp_path . 'wp-blog-header.php';

... to:

include_once $wp_path . 'wp-load.php';

(There is just once instance near the top of each file.)
I'd be very grateful if you could test this proposed solution in your own WordPress site and let me know if it works.
Thank you.

Re: Juicebox BUG!!! Pro version 1.5.0

Steven wrote:

I think I've found a solution to the problem.
Open the plugin's 'config.php', jb-config.php' and 'save-gallery.php' files in a plain text editor and change all instances of:

include_once $wp_path . 'wp-blog-header.php';

... to:

include_once $wp_path . 'wp-load.php';

(There is just once instance near the top of each file.)
I'd be very grateful if you could test this proposed solution in your own WordPress site and let me know if it works.
Thank you.

Thanks! This is working for me perfectly. As mentioned at the outset, that was way beyond my ability and I appreciate your solving it!

Re: Juicebox BUG!!! Pro version 1.5.0

You're welcome.
Thanks for testing the fix.
I'll make sure that it's included in the next version of WP-Juicebox.