Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
justinfreeman (Agileware)
Core
Commits
7583c3f3
Commit
7583c3f3
authored
12 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
multipledomain config get working
fix setting test to only call create if required
parent
0e04f44e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/BAO/Domain.php
+1
-0
1 addition, 0 deletions
CRM/Core/BAO/Domain.php
CRM/Core/BAO/Setting.php
+28
-13
28 additions, 13 deletions
CRM/Core/BAO/Setting.php
with
29 additions
and
13 deletions
CRM/Core/BAO/Domain.php
+
1
−
0
View file @
7583c3f3
...
...
@@ -114,6 +114,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
static
function
resetDomain
(){
CRM_Core_Config
::
domainID
(
null
,
true
);
self
::
getDomain
(
null
,
true
);
CRM_Core_Config
::
singleton
(
TRUE
,
TRUE
);
}
static
function
version
(
$skipUsingCache
=
false
)
{
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/BAO/Setting.php
+
28
−
13
View file @
7583c3f3
...
...
@@ -225,13 +225,13 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
$fields
=
$result
=
array
();
$fieldsToGet
=
self
::
validateSettingsInput
(
array_flip
(
$settingsToReturn
),
$fields
,
FALSE
);
foreach
(
$domains
as
$domain
)
{
CRM_Core_BAO_Domain
::
setDomain
(
$domain
);
if
(
$domain
!=
$originalDomain
){
foreach
(
$domains
as
$domainID
)
{
if
(
$domainID
!=
CRM_Core_Config
::
domainID
()){
$reloadConfig
=
TRUE
;
CRM_Core_BAO_Domain
::
setDomain
(
$domainID
);
}
$config
=
CRM_Core_Config
::
singleton
(
$reloadConfig
,
$reloadConfig
);
$result
[
$domain
]
=
array
();
$result
[
$domain
ID
]
=
array
();
foreach
(
$fieldsToGet
as
$name
=>
$value
)
{
if
(
!
empty
(
$fields
[
'values'
][
$name
][
'prefetch'
])){
$configKey
=
CRM_Utils_Array
::
value
(
'config_key'
,
$fields
[
'values'
][
$name
],
$name
);
...
...
@@ -247,16 +247,16 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
CRM_Utils_Array
::
value
(
'component_id'
,
$params
),
CRM_Utils_Array
::
value
(
'default_value'
,
$params
),
CRM_Utils_Array
::
value
(
'contact_id'
,
$params
),
$domain
$domain
ID
);
}
if
(
!
is_null
(
$setting
))
{
// we won't return if not set - helps in return all scenario - otherwise we can't indentify the missing ones
// e.g for revert of fill actions
$result
[
$domain
][
$name
]
=
$setting
;
$result
[
$domain
ID
][
$name
]
=
$setting
;
}
CRM_Core_BAO_Domain
::
resetDomain
();
}
CRM_Core_BAO_Domain
::
resetDomain
();
}
return
$result
;
}
...
...
@@ -346,9 +346,11 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
* @access public
*/
static
function
setItems
(
&
$params
,
$domains
=
null
)
{
$originalDomain
=
CRM_Core_Config
::
domainID
();
if
(
empty
(
$domains
))
{
$domains
[]
=
CRM_Core_Config
::
d
omain
ID
()
;
$domains
[]
=
$originalD
omain
;
}
$reloadConfig
=
FALSE
;
$fields
=
$config_keys
=
array
();
$fieldsToSet
=
self
::
validateSettingsInput
(
$params
,
$fields
);
...
...
@@ -356,8 +358,12 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
self
::
validateSetting
(
$settingValue
,
$fields
[
'values'
][
$settingField
]);
}
foreach
(
$domains
as
$domain
)
{
$result
[
$domain
]
=
array
();
foreach
(
$domains
as
$domainID
)
{
if
(
$domainID
!=
CRM_Core_Config
::
domainID
()){
$reloadConfig
=
TRUE
;
CRM_Core_BAO_Domain
::
setDomain
(
$domainID
);
}
$result
[
$domainID
]
=
array
();
foreach
(
$fieldsToSet
as
$name
=>
$value
)
{
if
(
empty
(
$fields
[
'values'
][
$name
][
'config_only'
])){
CRM_Core_BAO_Setting
::
setItem
(
...
...
@@ -367,7 +373,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
CRM_Utils_Array
::
value
(
'component_id'
,
$params
),
CRM_Utils_Array
::
value
(
'contact_id'
,
$params
),
CRM_Utils_Array
::
value
(
'created_id'
,
$params
),
$domain
$domain
ID
);
}
if
(
!
empty
(
$fields
[
'values'
][
$name
][
'prefetch'
])){
...
...
@@ -376,9 +382,18 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
}
$config_keys
[
$name
]
=
$value
;
}
$result
[
$domain
][
$name
]
=
$value
;
$result
[
$domainID
][
$name
]
=
$value
;
}
if
(
$reloadConfig
){
CRM_Core_Config
::
singleton
(
$reloadConfig
,
$reloadConfig
);
}
if
(
!
empty
(
$config_keys
)){
CRM_Core_BAO_ConfigSetting
::
create
(
$config_keys
);
}
if
(
$reloadConfig
){
CRM_Core_BAO_Domain
::
resetDomain
();
}
CRM_Core_BAO_ConfigSetting
::
create
(
$config_keys
);
}
return
$result
;
...
...
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