[TYPO3-extbase] Handle 404 error with extbase

Alexander Stehlik alexander.stehlik at gmail.com
Tue Mar 11 21:34:19 CET 2014


Hi Mohammed,

I think you need to make the action method argument optional (using a 
default value) and then handle the 404 error yourself when the argument 
is NULL.

A good examle is the news Extension:

https://forge.typo3.org/projects/extension-news/repository/revisions/master/entry/Classes/Controller/NewsController.php#L169

Hope this helps.

Kind regards,
Alex

Am 11.03.2014 21:23, schrieb Mohammed.Rebai at cspq.gouv.qc.ca:
> With extbase i developped an extension. And then i use Realurl for url
> rewriting.
> The problem is, for example, i execute this url :
> www.mysite.com/records/record-number-one/
> <http://www.mysite.com/records/record-number-one/> Everything is ok
> since the "record-number-one" does exist.
> Now if i try
> www.mysite.com/records/record-numbbbbbbber-one/
> <http://www.mysite.com/records/record-numbbbbbbber-one/>
> I got this error
> Exception while property mapping at property path "":The identity
> property "record-numbbbbbbber-one" is no UID.
> But i want to be redirected to the 404 page instead of getting this error!
> I tried to validate the record in my action and redirect to the 404
> page, but when i got this error, my code (in my action) is not even
> executed!
> After a lot of searches, some people say that if i set
> plugin.myplugin.mvc.throwPageNotFoundExceptionIfActionCantBeResolved = 1
> Or simply
> config.tx_extbase.mvc.throwPageNotFoundExceptionIfActionCantBeResolved = 1
> The error will be solved, i tried both and i still got the error.
> any help ?
> Thanks
> PS: i use TYPO3 6.1.7
> *Mohammed* *Rebai* || Conseiller en architecture organique | Direction
> du Centre de compétences Web
> *Centre de services partagés du Québec* | 800, place D'Youville, 15e
> étage, Québec (Québec) G1R 3P4
> Tél. : 418 644-3928| Téléc. : 418 266-2339
> _mohammed.rebai at cspq.gouv.qc.ca_ <mailto:mohammed.rebai at cspq.gouv.qc.ca>
> | _www.cspq.gouv.qc.ca_ <http://www.cspq.gouv.qc.ca>
> Ce message est confidentiel et est à l'usage exclusif du destinataire
> identifié ci-dessus. Toute autre personne est, par les présentes, avisée
> qu'il lui est strictement interdit de le diffuser, de le distribuer,
> d'en dévoiler le contenu ou de le reproduire. Si vous avez reçu cette
> communication par erreur, veuillez en informer l'expéditeur par courrier
> électronique immédiatement et détruire l'original de ce message ainsi
> que toute copie.


-- 
Alexander Stehlik
alexander.stehlik at gmail.com


More information about the TYPO3-team-extbase mailing list