[TYPO3-50-general] Discussion of MVC with validation error messages
Sebastian Kurfürst
sebastian at typo3.org
Sun Jul 5 21:53:59 CEST 2009
Hey everybody,
today I want to discuss three issues with you I have came across when
reviewing the code. They are all related to MVC and validation, and
fixing them might break backwards compatibility.
First: Inside the ActionController, there is a method called
"initializeActionMethodArguments", which parses the @param annotations
and collects the method parameters. If no method parameter has been
set (i.e. there is no @param annotation, and it is not of an object
type), then "Text" is being used. I think this is dangerous: The user
gets "Text" although he might have wanted something different, and the
error might only be seen in rare cases.
What do you think of throwing an exception in case no type has been
specified? I think this would be only consistent, and give the user an
error right away.
Second: Concerning Validation and the default errorAction: If I got it
correctly, the __referrer is evaluated for referring back to the
originating page where the error occured. Additionally, the _current_
arguments are being passed onto the _last_ action. I think quite
strange things can happen then, f.e. you can have mandatory parameters
which are not passed to the previous action :-( Do I have some
thinking error or is this the case? I think this whole issue can lead
to very strange behavior...
Maybe this can be solved by adding all current request parameters to
__referrer, and just using them again?
The first problem is easy to solve, but has to be discussed first, and
the second one is more difficult to solve I think... I just wanted to
post it here, in case somebody of you has a great idea :-)
Another thing which we really need to talk about: How will all these
conventions get documented? I think documentation writing should be a
really important task in the next weeks, as there is _a lot_ of stuff
undocumented. I know that things have been moving really fast
recently, but they should slowly settle down, and thus there should be
some docs available soon.
As soon as the documentation structure for the MVC part is clear, I'd
as well like to help out documenting some parts as I feel that it is
really important!
Greets and thanks for your time and opinions,
Sebastian
--
Gimme five!
More information about the TYPO3-project-5_0-general
mailing list