✔️ flexible solution that can be used for any future permission
❌ the modifier format is confusing, most people would probably expect a function call instead
{if 'access CiviCRM'|permissionCheck }
<!-- Do something -->
{/if}
function upgrade_174() {
$this->runAllClassesInDirectory('Upgrade_174');
}
class Upgrade_174_SetDrupalVariable implements UpgraderInterface {
public function upgrade() {
compudeploy
creates, deploys and updates CiviCRM websites
<?php | |
// Inside civihr_employee_portal.module.. | |
// this will enable logging before data is saved | |
function civihr_employee_portal_webform_submission_presave($node, &$submission) { | |
// todo restrict to certain nodes | |
$logger = Civi::container()->get(ApiChangelogWrapper::class); | |
$logger->setIsActive(TRUE); | |
} |
<?php | |
class CRM_MyExtension_Upgrader extends CRM_MyExtension_Upgrader_Base { | |
/** | |
* @inheritdoc | |
*/ | |
public function hasPendingRevisions() { | |
$revisions = $this->getRevisions(); | |
$currentRevisionNum = $this->getCurrentRevision(); |