Join GitHub today
Event storage-action gives result "success" although form throws error #69
My form has a couple of obligatory fields. The form correctly throws an error when one of them is not filled in. When the form succeeds storage should be dropped, when the form throws an error no storage-action should be taken. I added therefore the storage-action filter to my event and a hidden field as described on Github. The storage-action event however succeeds also when the form fails.
Thanks for you hints on how to solve this
That's the line I added as described in the manual:
Here is the XML I get when posting the form with a missing field:
Thanks for the precise description of your issue.
I am using the same setup, and it works perfectly for me. (When saving fails, the filter is not triggered, nor is the filter node included in the event repsonse.) Additionally I verified that Symphony (2.6.11, in my case) only executes such "final save" filters if an event has been sucessful.
Which version of Symphony is it? And is there any "hack" or "exotic extension" which might be responsible for this?
I found out what I did wrong: When using the event filter, the event must not be added to the page. If the event is added, the event filter will be ignored and the action will be executed in all cases. Maybe you could add this to the documentation.
After finding this out I am confused: What is the event for? On the same page I have two more forms that feed storage by Ajax. They still work without the event added, just by using a hidden field:
Best regards and thanks for the quick reply you sent
Oh, the events are intended to work like all other events in Symphony, they are triggered on page load. So the idea is to attach them to pages, for example an order confirmation page — so you can delete the "storage" when the confirmation page is loaded.
So the difference is:
Since Storage events and Storage filters use the same field names, the idea is to use only one of these.