Skip to content

Commit

Permalink
Merge pull request #29694 from colemanw/afformTitle
Browse files Browse the repository at this point in the history
Afform - fix missing page title
  • Loading branch information
eileenmcnaughton authored Mar 15, 2024
2 parents 06973ff + 62b2ddc commit f362d88
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ext/afform/core/CRM/Afform/Page/AfformBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public function run() {
Civi::service('angularjs.loader')
->addModules([$afform['module_name'], 'afformStandalone']);

// Title will be supplied by AfformBase.tpl.
// @see crmUi.directive(crmPageTitle)
CRM_Utils_System::setTitle('');

$isFrontEndPage = !empty($afform['is_public']);

// If not being shown on the front-end website, calculate breadcrumbs
Expand All @@ -43,8 +39,8 @@ public function run() {
}
}

// Add current afform page to breadcrumb
if (!empty($afform['title'])) {
// Add current afform page to breadcrumb
$title = strip_tags($afform['title']);
if (!$isFrontEndPage) {
CRM_Utils_System::appendBreadCrumb([
Expand All @@ -54,6 +50,13 @@ public function run() {
],
]);
}
// 'CiviCRM' be replaced with Afform title via AfformBase.tpl.
// @see crmUi.directive(crmPageTitle)
CRM_Utils_System::setTitle('CiviCRM');
}
else {
// Afform has no title
CRM_Utils_System::setTitle('');
}

parent::run();
Expand Down

0 comments on commit f362d88

Please sign in to comment.