Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Afform - fix missing page title #29694

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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