Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Extensions
form-processor
Commits
b148ef95
Commit
b148ef95
authored
Dec 14, 2020
by
jaapjansma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with try out in CiviCRM versions after 5.31.
parent
b5bad69f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
6 deletions
+42
-6
CHANGELOG.md
CHANGELOG.md
+3
-1
CRM/FormProcessor/Form/RunFormProcessor.php
CRM/FormProcessor/Form/RunFormProcessor.php
+37
-3
info.xml
info.xml
+2
-2
No files found.
CHANGELOG.md
View file @
b148ef95
Version 1.20
(not yet released)
Version 1.20
============
*
Fixed issue with try out in CiviCRM versions after 5.31.
Version 1.19
============
...
...
CRM/FormProcessor/Form/RunFormProcessor.php
View file @
b148ef95
...
...
@@ -95,7 +95,15 @@ class CRM_FormProcessor_Form_RunFormProcessor extends CRM_Core_Form {
],
]);
$refreshButton
=
false
;
if
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
]
==
E
::
ts
(
'Load'
))
{
// Before CiviCRM version 5.31 the submit button value was the label of the button.
$refreshButton
=
true
;
}
elseif
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
]
==
'1'
)
{
// CiviCRM version 5.31 onwards set a '1' value on the submit button.
$refreshButton
=
true
;
}
if
(
$refreshButton
)
{
$this
->
loadDefaultData
(
$this
->
formProcessorName
);
}
}
...
...
@@ -139,14 +147,32 @@ class CRM_FormProcessor_Form_RunFormProcessor extends CRM_Core_Form {
* @since 1.0
*/
public
function
validate
()
{
$return
=
parent
::
validate
();
// TODO: Change the autogenerated stub
$return
=
parent
::
validate
();
$submitButton
=
false
;
if
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
]
==
E
::
ts
(
'Submit'
))
{
// Before CiviCRM version 5.31 the submit button value was the label of the button.
$submitButton
=
true
;
}
elseif
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
]
==
'1'
)
{
// CiviCRM version 5.31 onwards set a '1' value on the submit button.
$submitButton
=
true
;
}
$refreshButton
=
false
;
if
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
]
==
E
::
ts
(
'Load'
))
{
// Before CiviCRM version 5.31 the submit button value was the label of the button.
$refreshButton
=
true
;
}
elseif
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_refresh'
]
==
'1'
)
{
// CiviCRM version 5.31 onwards set a '1' value on the submit button.
$refreshButton
=
true
;
}
if
(
$refreshButton
)
{
foreach
(
$this
->
fields
as
$field
)
{
if
(
isset
(
$this
->
_errors
[
$field
[
'name'
]]))
{
unset
(
$this
->
_errors
[
$field
[
'name'
]]);
}
}
}
elseif
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
]
==
E
::
ts
(
'Submit'
)
)
{
}
elseif
(
$submitButton
)
{
foreach
(
$this
->
defaultFields
as
$field
)
{
$submitFieldName
=
$this
->
formProcessorName
.
'_default_'
.
$field
[
'name'
];
if
(
isset
(
$this
->
_errors
[
$submitFieldName
]))
{
...
...
@@ -167,7 +193,15 @@ class CRM_FormProcessor_Form_RunFormProcessor extends CRM_Core_Form {
* This is a virtual function and should be redefined if needed
*/
public
function
postProcess
()
{
if
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
]
==
E
::
ts
(
'Submit'
)
&&
!
count
(
$this
->
_errors
))
{
$submitted
=
false
;
if
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
]
==
E
::
ts
(
'Submit'
))
{
// Before CiviCRM version 5.31 the submit button value was the label of the button.
$submitted
=
true
;
}
elseif
(
isset
(
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
])
&&
$this
->
_submitValues
[
'_qf_RunFormProcessor_submit'
]
==
'1'
)
{
// CiviCRM version 5.31 onwards set a '1' value on the submit button.
$submitted
=
true
;
}
if
(
$submitted
&&
!
count
(
$this
->
_errors
))
{
$params
=
[];
foreach
(
$this
->
fields
as
$field
)
{
$submitFieldName
=
$field
[
'name'
];
...
...
info.xml
View file @
b148ef95
...
...
@@ -16,8 +16,8 @@
<url
desc=
"Licensing"
>
http://www.gnu.org/licenses/agpl-3.0.html
</url>
<url
desc=
"Action-Provider Extension"
>
https://lab.civicrm.org/extensions/action-provider
</url>
</urls>
<releaseDate>
2020-12-
09
</releaseDate>
<version>
1.20
-dev
</version>
<releaseDate>
2020-12-
14
</releaseDate>
<version>
1.20
</version>
<develStage>
stable
</develStage>
<compatibility>
<ver>
4.7
</ver>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment