Topic: Juicebox Error: Config XML file not found.

I’m using:
juicebox_pro_1.4.0
Drupal 7.27
project/juicebox (juicebox 7.x-2.x-dev)

I just started getting this: “Juicebox Error: Config XML file not found.”
It has been working just fine until the other day.

Steps I’ve taken to fix:
I disabled every module one by one > cleared cache.  No change.
I change my theme to eliminate any custom CSS or file changes. No change.
I was using juicebox pro 1.3.3 and upgraded to 1.4.0. No change.
I was using project/juicebox 7.x.1 and upgraded to 7.x-2.x-dev. No change.
Complete removed juicebox. Drop any reference to it in my DB. Then Installed fresh 1.4 plus the dev of drupal project. No change.

I’ve read some of the support responses on your forum and seen that a big concern is baseUrl. I didn’t understand all that, but it would seem that is not something I’m troubled with since juicebox has been working just fine. However, I do know that my baseURL in my settings.php file is “www.sitename.com”. That’s always been set that way.

Additional info:
Not sure this will help but here is how the folder/file structure is used on my site.

sites/all/libraries/juicebox
classic
images
thumbs
full.html
index.html
juicebox.js
config.xml

Drupal project page explains it this way.

“Copy the appropriate core Juicebox library files that you just extracted to Drupal's library directory. Typically, this means you will create a new directory called /sites/all/libraries/juicebox and then copy the full contents of the the Juicebox "jbcore" directory to this library directory. You will end up with a structure like /sites/all/libraries/juicebox/juicebox.js and /sites/all/libraries/juicebox/classic/themes.css, etc.”

It doesn’t mention what to do with images/ , thumbs/, config.xml, index.html. I just threw them in juicebox/.  (not sure that’s the correct way, but like I said it’s been working fine like this ever since I bought pro.)

Showing debugging information in place of gallery.
Gallery ID
field--node--253--field-re-photos--full
XML URL
http://www.mysite.com/?q=juicebox/xml/f … hotos/full
Juicebox Javascript Library
Locally Installed, Pro 1.3.3
Image Count
7 images
Juicebox Gallery Options
•    gallerywidth=100%
•    galleryheight=350px
•    backgroundcolor=#FFFFFF
•    textcolor=rgba(255,255,255,1)
•    thumbframecolor=rgba(255,255,255,.5)
•    showopenbutton=FALSE
•    showexpandbutton=TRUE
•    showthumbsbutton=FALSE
•    usethumbdots=FALSE
•    usefullscreenexpand=FALSE
•    screenmode=AUTO
•    showsplashpage=NEVER
•    maxthumbrows=1
•    imagetransitiontime=.3
•    enablelooping=FALSE
•    gallerytitleposition=OVERLAY
•    captionposition=OVERLAY_IMAGE
•    showimagenav=FALSE
•    firstimageindex=1
•    showsmallthumbsonload=FALSE
•    showsmallthumbsbutton=FALSE
•    thumbwidth=50
•    thumbheight=50

Thank you

Regards,

Re: Juicebox Error: Config XML file not found.

It has been working just fine until the other day.

Something must have changed for this to happen.
If you did not change anything yourself, then check to see if any automatic updates to your Drupal installation were installed.
Also, check with your web server to see if they have changed anything recently (such as upgrading the version of PHP installed or changing any PHP settings) which may be contributing to your problem.

It would be much easier to troubleshoot your scenario if you were able to provide the URL to the gallery in question so that I could take a look for myself. Without seeing your gallery's embedding code, I have no way of knowing how the path to your gallery's XML file is defined.
It sounds like the PHP file within the Drupal module which dynamically generates the XML data may have somehow become corrupt or missing but, if this were the case, then re-uploading the module's files to your web server (which you have already tried) should solve the problem.

It doesn’t mention what to do with images/ , thumbs/, config.xml, index.html.

These files and folders are unique to each individual gallery and it is not necessary to copy them into the module's own file structure. (The module deals with these files and folders each time you create a gallery.) Only the 'jbcore' folder should be integrated within the module.

As we did not write the module ourselves (and the problem you are encountering seems to be related to the gallery's embedding code which is generated by the module), you might also like to post in the Drupal forum where the author of the module should be able to help.

However, if you continue to experience difficulties, please post back with the URL to your gallery and I will certainly try to help further.

Re: Juicebox Error: Config XML file not found.

Steven, thanks for the quick response here.

Can you see "support@juicebox.net" email? Look for an email with your name in the subject.

Re: Juicebox Error: Config XML file not found.

Thank you for providing the URL to your gallery via email.
It looks like the data for your gallery's XML file is being generated correctly so all the correct files are in place and not corrupt.
However, the problem seems to be that the XML declaration in the dynamically generated XML file (the <?xml version="1.0" encoding="UTF-8"?> line) is not at the very top of the document. There is a blank line before the XML declaration which should not be there and this is very likely to be the cause of the problem.

I cannot be certain but I suspect this may be a bug in the version of PHP which is installed on your web server.
(What version of PHP is installed on your web server and has your web host recently upgraded the version of PHP or changed any PHP settings?)
Please try the following suggestion which should hopefully solve your problem:

Open the module's 'juicebox/includes/JuiceboxGallery.inc' file in a plain text editor and change line 171 from:

return $dom->saveXML();

... to:

return $dom->saveXML($juicebox);

Please note that the line number above refers to the recommended release of the module (dated 2014-Jan-28) which is available from this web page.

5 (edited by mark44345 2014-04-19 10:21:14)

Re: Juicebox Error: Config XML file not found.

Steven...genius!  Changing “return $dom->saveXML();” to “...saveXML($juicebox);” worked!

Also, I made this change to release: 7.x-2.0-beta5+8-dev (https://drupal.org/project/juicebox) and it fixed it just the same.
------------
For:     7.x-2.0-beta5+8-dev
File: sites/all/modules/juicebox/includes/JuiceboxGallery.inc
Line: 174
-    return $dom->saveXML();
+    return $dom->saveXML($juicebox);
------------

So, have you identified an error in this line of code, or is it a temporary fix unique to my case? I guess what I’m asking is “do I still have a problem somewhere else that’s causing this?” Is this something that should be reported to the project maintainers (drupal)?

My PHP is:   5.3.26 (I don't know when it was last updated)

Thanks for working this so quickly!

Mark

Re: Juicebox Error: Config XML file not found.

So, have you identified an error in this line of code, or is it a temporary fix unique to my case?

The code within the Drupal module should work OK (it is valid PHP and should work according to the PHP specifications) so I suspect a bug in your web server's PHP version (v5.3.26) may be the cause of the problem.
I have a feeling that if your web server's version of PHP was upgraded (to a version where this bug has been fixed), then there would be no need to apply this fix.

7 (edited by ryan 2014-08-06 14:51:39)

Re: Juicebox Error: Config XML file not found.

Hi there,

I maintain the Drupal Juicebox module and frequently get questions about this kind of issue. In fact, some Drupal users have started to reference the suggestion in this juicebox.net post as a "fix" (that's how I learned of this thread).

There are conditions that can occur with a Drupal install where every page prints extra whitespace at the beginning of its markup, which then interferes with all XML that Drupal tries to generate. This is usually related to bad code in another Drupal module and almost always has nothing to do with Juicebox or the Drupal Juicebox module. The fix posted here provides a temporary workaround by simply masking a bigger underlying problem with a Drupal instance (again, independent of the Drupal module). In this regard I would not look at the code change above as a fix, but only a temporary workaround, or something that might help with troubleshooting.

Fixing the underlying whitespace issue properly might save future Drupal headaches for people encountering this, and is always recommended.

For anyone interested to know more, I suggest looking at: https://www.drupal.org/node/2312037