Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search.Prg killing request data #31

Closed
davidyell opened this issue Aug 20, 2015 · 4 comments
Closed

Search.Prg killing request data #31

davidyell opened this issue Aug 20, 2015 · 4 comments

Comments

@davidyell
Copy link
Member

What I did
Added the Search.Prg component to my AppController.

What I expected to happen
I could save an edit form and the data would be saved and updated.

What actually happened
The form said it saved, yet no change to the data occurred.

How I fixed it
I removed the Search.Prg component and my form saved and updated as expected.

What I think the problem is
https://github.com/FriendsOfCake/search/blob/master/src/Controller/Component/PrgComponent.php#L20
An edit action is put, so this will wipe out the request data.

@davidyell davidyell changed the title Search.PRG killing request data Search.Prg killing request data Aug 20, 2015
@dereuromark
Copy link
Member

You could probably just check on put or post (and maybe even patch) here.
Basically !get :)

@ADmad
Copy link
Member

ADmad commented Aug 20, 2015

This is why the example code in readme shows to load the component only for index action 😉

@ADmad
Copy link
Member

ADmad commented Aug 20, 2015

Querystring is set to request->data so that the search form is populated with existing search terms. IMO this is just a matter of improving the docs.

@davidyell
Copy link
Member Author

This also kills the delete method if it's active in the controller, as it redirects the request meaning your delete is get, so the allowMethods call fails.

davidyell added a commit to davidyell/search-1 that referenced this issue Sep 2, 2015
Removed the example where the component isn't wrapped in a check for an action.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants