PDA

View Full Version : Revisited problem: Empty <li> tagsets, RCs 4 and 5


vkaryl
08-20-2005, 03:12 AM
::Preface::

(This is a pretty long post, sorry....)

While implementing phpLD for directories on several sites I became aware that the program, an otherwise fairly standards-compliant script [1] was arbitrarily inserting an empty
tagset in subcategory lists on a regular basis. Pages produced by the script validated; but an empty tagset is certainly not ideal nor standards-compliant, and might cause directories to break validation at some point in the future. This was therefore problematic.

::Current Situation::

I chose to request assistance from the Smarty template support forum (since phpLD is based upon the Smarty Templating Engine).

Following is code submitted on the Smarty forum:
------------------------------------------------------------
Relevant code from main.tpl submitted to Smarty forum (these are the sections which echo category and subcategory lists to screen):

Content visible to registered users only.Source code parsed from above submitted to Smarty forum (derived by viewing source of the index page):

------------------------------------------------------------

Following are quotes from the Smarty forum responses at http://www.phpinsider.com/smarty-forum/viewtopic.php?t=6007....

Post by mohrt, Smarty forum admin:
Content visible to registered users only.mohrt, again:

Content visible to registered users only.boots, Smarty forum administrator replied:


Content visible to registered users only.::Resolution::

This was an issue within the code provided by the phpLD team for the subcategory section display, wherein an empty
tagset was being created in any given list of subcategories. In originally posting regarding this problem, I noted that pages validated even with the empty tagsets, but that I considered it sloppy coding. Casey became defensive, pointing out that had I been using tables instead of tableless layout I wouldn't be having the problem.

mohrt and boots from the Smarty forum keyed immediately upon the offending code in the original template which is contained within both recent RC versions, 4 and 5, in the main.tpl file. You will note that the problem code within the subcat section was code which "came standard" with both RC4 and RC5. This is certainly nothing that I inserted - it was already there. Removing it fixed the empty tagset problem.

"offending code" from the "subcategory" section of:

RC4
Content visible to registered users only.and

RC5
Content visible to registered users only.Once I removed the "offending" section of the code the pages now have no empty tagsets in the subcategory lists. This was certainly not a huge programming fix: it took the folks at the Smarty forum less than 20 minutes to look over the code I provided and explain the problem. If I, a total newbie to Smarty and to phpLD, can remove offending code once I am shown where the problem occurred, surely the programming team at phpLD should have been able to determine where the problem lay and provide the same information instead of saying in essence, "too bad - you aren't using tables, we can't help you since we don't know anything but tables"....

::NB::

kickass
08-20-2005, 04:45 AM
I've implemented this fix. It works beautifully. THANKS!

David
08-20-2005, 05:53 AM
First of all, thank you for contributing the code. That is WONDERFUL. Open source is about working together.

This is a relatively new open source project. Considering we went open source around the beginning of June, I think we are doing great. Let's continue to try to work together (pretty please).

In defense of Casey, he is the second largest contributor to the code base, and I hope that you will also thank him for a job well done, as he deserves it.

We will take care of this issue in the next release.

Thanks,
David

kickass
08-20-2005, 03:33 PM
Content visible to registered users only.

David, vkaryl and I have been trying to do just that. But when questions get dealt with the way this one was prior to you stepping in it sorta leaves a bad taste in my mouth and makes it difficult to be motivated to contribute more here. I feel as if the spirit of Open Source isn't truly being embraced by the whole community. I hope that changes soon so we can get on with business.

vkaryl
08-20-2005, 09:23 PM
kickass, I'm glad to hear it's working for someone else too, it's never a given that what works for one will work for other installations.

David, I'm more than happy to work with the dev team now and in the future. I don't see any reason at this point that it wouldn't be possible. I think it's simply a matter of everyone accepting that each person's attitudes and abilities are different and that what's acceptable in some areas is not in others - especially where support fora and open source software are concerned.

I do think its great that you have some talented coders in Casey, yktan, and dgb. And it's somewhat understandable that they might not be thrilled with people doing something with the program that they feel isn't "right" for whatever reason. However, that's the absolute beauty of open source software: it's meant to be flexible as well as free, that's the root point. But that also means the programmers and support personnel need to flex a bit as well when it comes to responding to support questions.

Ap0s7le
08-20-2005, 10:01 PM
Nice job vkaryl.