Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mjwshared
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
mjwshared
Commits
e2039573
Commit
e2039573
authored
4 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Load crm.payment.js early on
parent
37ab0f41
No related branches found
No related tags found
1 merge request
!9
0.9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mjwshared.php
+8
-3
8 additions, 3 deletions
mjwshared.php
with
8 additions
and
3 deletions
mjwshared.php
+
8
−
3
View file @
e2039573
...
...
@@ -23,9 +23,11 @@ function mjwshared_civicrm_config(&$config) {
if
(
isset
(
Civi
::
$statics
[
__FUNCTION__
]))
{
return
;
}
Civi
::
$statics
[
__FUNCTION__
]
=
1
;
//
Add listeners for CiviCRM hooks that might need altering by other script
s
//
Symfony hook priorities - see https://docs.civicrm.org/dev/en/latest/hooks/usage/symfony/#prioritie
s
// Make sure this runs after everything else but before minifier
Civi
::
dispatcher
()
->
addListener
(
'hook_civicrm_buildAsset'
,
'mjwshared_symfony_civicrm_buildAsset'
,
-
990
);
// This should run before (almost) anything else as we're loading shared libraries
Civi
::
dispatcher
()
->
addListener
(
'hook_civicrm_buildForm'
,
'mjwshared_symfony_civicrm_buildForm'
,
1000
);
}
/**
...
...
@@ -153,15 +155,18 @@ function mjwshared_civicrm_entityTypes(&$entityTypes) {
/**
* This hook is invoked when the 'confirm register' and 'thank you' form is rendered
*/
function
mjwshared_civicrm_buildForm
(
$
formName
,
&
$form
)
{
function
mjwshared_
symfony_
civicrm_buildForm
(
$
event
,
$hook
)
{
// Load the CRM.payment library
// We want this library loaded early. Weights are negative earlier, positive later (opposite to symfony).
// CiviCRM "earliest" is -9999 we'll go with -2000 to load after CiviCRM core but before anything else.
$region
=
(
CRM_Utils_Request
::
retrieveValue
(
'is_drupal_webform'
,
'Boolean'
,
FALSE
))
?
'billing-block'
:
'page-header'
;
\Civi
::
resources
()
->
addScriptUrl
(
\Civi
::
service
(
'asset_builder'
)
->
getUrl
(
'crm.payment.js'
,
[
'path'
=>
\Civi
::
resources
()
->
getPath
(
E
::
LONG_NAME
,
'js/crm.payment.js'
),
'mimetype'
=>
'application/javascript'
,
]
),
1
000
,
'billing-block'
);
),
-
2
000
,
$region
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment