As now, "Save" button appears unconditionally when adding some form elements to a view and I agree it should be the default behavior. But here are some other use cases that don't require a Save button, i.e. if the form elements added to the view are #submit elements themselves.
Now the workaround is to unset or set #access to 0 via form_alter, but maybe it's a good idea not to display the button in some cases.
I've played a little with this adding a property to the form (in views_form of the handler i.e.) in order to set if the Save button should be built or not, but the risk of this is having a mix of non-submit elements and submit elements, then the Save button won't appear and it may be expected to.
Comments
Comment #1
merlinofchaos commentedSee how the Theme: Information page does it. The button needs to be there, but that page changes the value so it doesn't say Save.
Comment #2
pcambraSorry to reopen this, but maybe I didn't explain myself good enough:
Just saying that if you add some submit elements to a view Save button shouldn't be there at all, because each field has its own submit button, for example:
https://skitch.com/pcambra/ggurt/orders-commerce-kickstart
(This is from Commerce Reorder module)
If you confirm it isn't enough reason for put some conditions to the general Save button, I'll hide it with a form alter which also works great.
Comment #3
frixos12 commentedsubscribing
Comment #4
vladimirausIt is an issue for "Wight" module.
When view is empty, "Save" button is still there.
http://drupal.org/node/1432078
Comment #5
muhleder commentedIt would be nice if we could alter the submit buttons in views handlers in $handler->views_form.
At the moment, the buttons are added right after our handlers get a chance to alter the form. If they were added before we could decide in our own handlers what whether we want a button or what it should say.
views.module#1789
Comment #6
michfuer commentedSubscribing.
Comment #7
aytee commentedThe solution that I implemented was this:
1. Create a custom module with this hook_form_alter() function:
2. Install and Enable the Modules Weight module
3. In the Modules Weight configuration page, change the Weight of your CUSTOM_MODULE to be greater than Views so that your custom module hook_form_alter will fire after the Views.