[TYPO3-mvc] Recent change in method argument handling

Xavier Perseguers typo3 at perseguers.ch
Fri Aug 21 11:41:51 CEST 2009


Hi,

> I had this in my controller:
> 
> public function searchAction($lastName, $firstName, $street) {
> 
> }
> 
> and before my holidays (10th August), I was able to post data to the 
> search action using POST variables containing the search criteria (which 
> could be empty). E.g.,
> 
> POST /path/to/page/containing/controller
>     lastName
>     firstName Xavier
>     street
> 
> Meaning I'm searching all "Xavier".
> 
> This worked. Now I get these errors instead:
> 
> Error:   Required property 'lastName' does not exist.
> Error:   Required property 'firstName' does not exist.
> Error:   Required property 'street' does not exist.
> 
> I tried to change my definition to
> 
> public function searchAction($lastName = NULL, $firstName = NULL, 
> $street = NULL) {
> 
> }
> 
> But this time my POST parameters are not passed anymore, meaning all 
> parameters received by searchAction are NULL.

Digging into subversion logs, I found that this patch was applied:
http://forge.typo3.org/attachments/1472/3316_POST_arguments_must_be_namespaced.patch

Meaning both GET and POST parameters are now namespaced (I thought about this). Meaning I have to change my POST parameters from

lastName
firstName
street

to

tx_<extension>_<plugin>[lastName]
tx_<extension>_<plugin>[firstName]
tx_<extension>_<plugin>[street]

But I now have to find a way to get this when playing with ExtJS as I need this:

ds.load({
	params: {
		lastName: search_view.findById("lastName").getValue(),
		firstName: search_view.findById("firstName").getValue(),
		street: search_view.findById("firstName").getValue(),
	},
	callback: Members.searchCompleted
});

But I cannot replace lastName with tx_myext_search[lastname] as this later is not a valid name for an object property...

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-typo3v4mvc mailing list