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

Make submitOnce() button js into a button parameter #13333

Merged
merged 1 commit into from
Feb 7, 2019

Conversation

mattwire
Copy link
Contributor

Overview

Multiple different forms implement the same javascript line to add a submitOnce() button handler to the submit buttons. CRM_Core_Form::addDefaultButtons() has a parameter to add this but it's not really very generic as most forms call CRM_Core_Form::addButtons().

This PR adds a parameter submitOnce to the button create array which will automatically add that handler for any button that sets that to TRUE. The parameter is added initially for the "Open Case" form submit buttons.

Before

Every time you want a "submit only once" button you have to add the same line of javascript to the button array parameters.

After

Every time you want a "submit only once" button just add the parameter submitOnce = TRUE.

Technical Details

Comments

Standardise and simplify the way we add form buttons.

@civibot
Copy link

civibot bot commented Dec 20, 2018

(Standard links)

@civibot civibot bot added the master label Dec 20, 2018
@eileenmcnaughton
Copy link
Contributor

@colemanw can you check this one?

@mattwire
Copy link
Contributor Author

mattwire commented Feb 7, 2019

@colemanw Ping :-) Are you able to take a look?

@colemanw
Copy link
Member

colemanw commented Feb 7, 2019

Just tested this. Makes sense, and more important, it works :)

@colemanw colemanw merged commit de79767 into civicrm:master Feb 7, 2019
@mattwire mattwire deleted the buttons_submitOnce branch March 1, 2019 11:23
@demeritcowboy
Copy link
Contributor

Hi, this seems to break the Save and New button. It saves but doesn't present the new form.
https://lab.civicrm.org/dev/core/issues/904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants