Tuesday 04 September 2007 11:23:05 am
About your "validation" question, I think using the "option" datatype as information collector would be a good choice if you didn't have the text to set when selecting "other".
In EZP, validation implementation is bring by datatypes themselves.
See these methods :
validateClassAttributeHTTPInput (validate input from a class edit form)
validateObjectAttributeHTTPInput (validate input from a content object edit form)
validateCollectionAttributeHTTPInput (validate input from an information collector form)
You can find them explained by comments in eZDataType class, in the /kernel/classes/ezdatatype.php. Each datatype extends this class, and need to overload these methods to implement their specific validation. If you can't found existing datatypes that meet your needs, I suggest you to build your own, and made it to work as an information collector. You can also imagine not use information collection but rather create custom objects in your content tree, but it won't spare you the task to write custom datatypes if it's really needed.. you will have to validate the object rather than the information collection : the complexity is only moved, and more, it may make your content tree becoming really huge, and the collected data would be more difficult to use (especially if usage is externalised). The last otion I see would be to create a custom eZ module, in which you will be free about data storing, retrieving, validating and so. You can build your script nearly as you would have done with a standard php site, and associate it with a template.
For your second question about the "object is not available error", do you have passed the object IDs into hidden fields into your form ?
You should at least have something like this in your template: <input type="hidden" value="{$object.id}" name="ContentObjectID"/>
|