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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

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

Post 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??
Last edited by Russ on Sun Oct 29, 2006 6:47 am, edited 1 time in total.
Post Reply

Return to “Developers Discussion”