Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
Development
CiviCRM Core
Commits
478107f1
Commit
478107f1
authored
5 years ago
by
Andie Hunt
Browse files
Options
Downloads
Patches
Plain Diff
#832
CiviCase: rebuild case activity views during upgrade
parent
b632d5ee
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Upgrade/Incremental/php/FiveFourteen.php
+34
-15
34 additions, 15 deletions
CRM/Upgrade/Incremental/php/FiveFourteen.php
with
34 additions
and
15 deletions
CRM/Upgrade/Incremental/php/FiveFourteen.php
+
34
−
15
View file @
478107f1
...
...
@@ -67,21 +67,40 @@ class CRM_Upgrade_Incremental_php_FiveFourteen extends CRM_Upgrade_Incremental_B
* (change the x in the function name):
*/
// /**
// * Upgrade function.
// *
// * @param string $rev
// */
// public function upgrade_5_0_x($rev) {
// $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
// $this->addTask('Do the foo change', 'taskFoo', ...);
// // Additional tasks here...
// // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
// // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
// }
/**
* Upgrade function.
*
* @param string $rev
*/
public
function
upgrade_5_14_alpha1
(
$rev
)
{
$this
->
addTask
(
ts
(
'Upgrade DB to %1: SQL'
,
array
(
1
=>
$rev
)),
'runSql'
,
$rev
);
// Only need to rebuild view if CiviCase is enabled: otherwise will be
// rebuilt when component is enabled
$config
=
CRM_Core_Config
::
singleton
();
if
(
in_array
(
'CiviCase'
,
$config
->
enableComponents
))
{
$this
->
addTask
(
'Rebuild case activity views'
,
'rebuildCaseActivityView'
,
$rev
);
}
// Additional tasks here...
// Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
// The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
}
// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
// return TRUE;
// }
/**
* Rebuild the view of recent and upcoming case activities
*
* See https://github.com/civicrm/civicrm-core/pull/14086 and
* https://lab.civicrm.org/dev/core/issues/832
*
* @param CRM_Queue_TaskContext $ctx
* @return bool
*/
public
static
function
rebuildCaseActivityView
(
$ctx
)
{
if
(
!
CRM_Case_BAO_Case
::
createCaseViews
())
{
CRM_Core_Error
::
debug_log_message
(
ts
(
"Could not create the MySQL views for CiviCase. Your mysql user needs to have the 'CREATE VIEW' permission"
));
return
FALSE
;
}
return
TRUE
;
}
}
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