[TYPO3-mvc] [Extbase] Calling errorAction() from other action

Claus Fassing claus at fassing.eu
Wed Sep 15 16:08:28 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I check in the createAction the filesize from an uploaded file against
max. allowed filesize from TS settings.
If this failed I set a message
$this->flashMessageContainer->add('Wrong filesize !');
and call errorAction().
This is working, the view is recalling, but the message don't appear.

Can I call errorAction() from other action and throwing a message ?

I play a bit round with the following, but without success.

$error = new Tx_Extbase_MVC_Controller_ArgumentError('Wrong filesize
!', 1284476850);				$this->argumentsMappingResults->addError($error,
'newOffer');

Do I miss any other settings ?

In this case I'm not able to use any kind of validators, cause the image
field is type of
Tx_Extbase_Persistence_ObjectStorage<Tx_Mioffers_Domain_Model_Image>
In case of validation this field, I only will get the object
Tx_Extbase_Persistence_ObjectStorage as value.

The createAction get the aggregate root object and it will not help to
validate this, cause I need the TS settings array.

The only one, I guess, which could work is to use an intermediate object
with the needed information to validate. But I have to build this object
with all my form fields and that are many.

Are there any other solutions ?

Regards Claus

TYPO3 : 4.4.2
Extbase : 1.3.0alpha1
Fluid : 1.3.0alpha1

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMkNNbAAoJELsIv+audObfiKcIAImDNIy+rPz4RrFD03zunHMO
PpmqHpi7OnGssRvI8+sLcpwesmNzuL3Ro/YZSF/67EujQ45ux77OorScm0QL75/s
/vm77Ni69tsnUua6Apcl0TVkytgnftpjkt4LVEWp7A0rk2Ib67MP4fovW1nPmCb1
DAjTl+4zQ477F58craXkE9UOrPJf1VMTXLheoAJVqKoAknEKbn3ptDwhbLsgKFgV
S0wu5sfKdfL1133NaJi3utck02UQUEojUPzWkozbyLYBkHntjkbLbFLVSM22EvoK
frdjXvKINxMQ/yvq/8phJxkfyiR2gNFXj09WgQpr1z2vnCglCzfQQYREOEH6904=
=uIKT
-----END PGP SIGNATURE-----


More information about the TYPO3-project-typo3v4mvc mailing list