website TOC Garbled with 2014.2.15.0 when implicit URL is used

Topics: Developer Forum, User Forum
Mar 25, 2014 at 8:58 PM
I recently upgraded from 1930 to 2014.2.15.0.

I notice that with the new SHFB, the website output now displays a garbled TOC when I do not include "index.html" in the url, as in:

https://www.dropbox.com/s/59ebzuqwos72pjw/bad.png

If the URL includes "index.html", then the TOC is fine:

https://www.dropbox.com/s/zqecoipnq6fstdo/good.png

The problem is present in both the 2005 and 2010 presentation styles.

The web server is a plain-vanilla Apache distribution (XAMPP 1.7.2). As I noted above, this is a change from the older version.

Has anyone else seen this? Ideas?
Coordinator
Mar 25, 2014 at 9:21 PM
From the image, it looks like it's defaulting to the index.php page and failing perhaps because PHP is not enabled (that's the script you will find in the index.php file). You probably just need to configure your website to use index.html as the default page or delete index.php so it goes to the index.html version first.

Eric
Mar 26, 2014 at 2:50 PM
Thanks Eric.

I changed the load order in my httpd.conf file which fixed the problem.

I did a little bit of debugging, and it looks like there are some issues in the TOC.js script when a container node does not have an associated URL (which is the case for my project). This code generates an exception, for example:
   // Iterate nodes looking for the target
    var targetNode = null;

    for(i = 0; i < x.length; i++)
    {
        var id = x[i].getAttribute('Url');    <<-- id will be null if the node doesn't have an URL

        id = id.substring(id.lastIndexOf("/") + 1, id.length - (id.length - id.lastIndexOf(".")));  <<-- throws an exception because id is null

        if(id == target)
        {
            targetNode = x[i];
            break;
        }
    }
I don't know enough (any) PHP to figure out why invoking TOC.js from the PHP script fails while the same script works well enough from index.html.

But my problem is solved for the time being.

Ed
Coordinator
Mar 26, 2014 at 7:32 PM
It doesn't execute that code when index.html is used. I've added a null check so that should take care of it for future releases.

Eric