Page 1 of 1

Valid XHTML Search module, modform.inc.php, Album and perhaps other modules

Posted: Sun Oct 29, 2006 6:45 am
by Russ
I had a problem with the Album module, saving stuff in Admin, templates, comments etc. See:
http://forum.cmsmadesimple.org/index.ph ... l#msg40801

I had modified 'modform.inc.php' code in module support to try and get the in-built 'Search' module to verify as valid XHTML. Otherwise it fails with
Error  Line 98 column 359: there is no attribute "name".
... <form id="cntnt01moduleform-1" name="cntnt01moduleform-1" method="get" actio
Basically the 'name attribute has been deprecated. Piratos pointed out the role of 'modform.inc.php'  so I amended it like so...

Replacing...

Code: Select all

	//$text = '<form id="'.$id.'moduleform-'.$idsuffix.'" name="'.$id.'moduleform-'.$idsuffix.'" method="'.$method.'" action="'.$goto.'"';//moduleinterface.php
with...

Code: Select all

$text = '<form id="'.$id.'moduleform-'.$idsuffix.'" method="'.$method.'" action="'.$goto.'"';//moduleinterface.php
...  losing the 'name' attribute, which of course enables the 'Search' module to validate. One unforeseen problem was my problem with Album above.

Now, either I did this wrong (quite likely), or Album is using the 'name' attribute to do some stuff - which perhaps it shouldn't?? Either way I can have Album working and an invalid search form or Album not working and a valid search form. This problem may affect other forms.

Hope this helps, I've cross posted here because it may effect other modules.

Russ

P.S. I have to say I find this smarty form stuff a bit complicated and perhaps it is a bit of a memory / speed hog??