Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a1

Bug #10870 Dead links generated with HTML:Smarty:Php
Submitted: 2007-04-28 04:50 UTC Modified: 2007-05-04 16:19 UTC
From: isnull Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.0a1)
PHP Version: 5.2.1 OS: Irrevelant
Roadmaps: 1.4.0a2    
Subscription  


 [2007-04-28 04:50 UTC] isnull
Description: ------------ Dead links [ class tree: ] [ index: ] Test script: --------------- go to http://manual.phpdoc.org/HTMLSmartyConverter/PHP/elementindex.html ([ all elements ])

Comments

 [2007-04-28 04:50 UTC] isnull
it's fixable in header.tpl
 [2007-05-01 12:42 UTC] ashnazg (Chuck Burgess)
Confirmed this. It affects all three of the Smarty converters (PHP, HandS, default).
 [2007-05-01 12:50 UTC] ashnazg (Chuck Burgess)
This does NOT appear to affect the frames converters.
 [2007-05-04 08:43 UTC] ashnazg (Chuck Burgess)
Further scrutiny shows that those two links are only dead when used from the elementindex.html page, the "all elements" link in the top right of all pages. When viewed from other pages, the URLs point to files like: - classtrees_{packagename}.html - elementindex_{packagename}.html but on the "all elements" elementindex.html page, those URLs are missing the {packagename} piece, and therefore not pointing to a valid file. I assume since, on the "all elements" page, you're viewing things from "above" any particular package level, then those two links don't seem to have a packagename on them. Should they probably just default to the default package name?
 [2007-05-04 09:30 UTC] ashnazg (Chuck Burgess)
I can't figure out how to derive the default package name in the .tpl files, but I was able to wrap an IF around the ClassTree and Index header links, so that if the "package" variable has no value when the page is being generated, then those two links are omitted. That works good.
 [2007-05-04 09:33 UTC] ashnazg (Chuck Burgess)
I now see that a similar problem exists on the home index.html header on the Smarty templates. The ClassTree and Index links do have a package name in their filename this time ("default"), since the default package name is the one displayed on the home index.html page. However, it my tests, there are no objects in the "default" package, so these links point to nonexistent files. I guess I now need to figure out how to count a package's objects, and omit the links if the object count is zero.
 [2007-05-04 13:18 UTC] ashnazg (Chuck Burgess)
Worked with originator (isnull) on IRC, he/she showed me a flag-setting loop around the packageindex array that looks like it will work, to solve the dead links on both home index.html as well as All Elements Index page. I'm attaching patches, one for each header.tpl in the Smarty templates. Josh, ready for review.
 [2007-05-04 14:34 UTC] isnull
Submitted a patch making the Smarty converter class to use an intermediate fetch method to play with. Method _fetch($template_file, &$template_object) and proceeds to fetch() and it's called instead of the direct fetch(). It's not functional yet and i don't know why and i broke my debugger and i probably won't have time before 4-5 days. Good luck.
 [2007-05-04 16:19 UTC] ashnazg (Chuck Burgess)
Committed header.tpl patches to CVS.