Files
breadcrumb-the-shire/pages/admin/tenants/create(default).phtml
fs e29e6c3136 fix(tenants-create): define $canUpdateTenant before form partial
The shared _form.phtml partial reads $canUpdateTenant for the per-theme
logo upload blocks added in 6e3fc63c, but create(default).phtml never
defined it — every visit to admin/tenants/create raised an undefined-
variable warning and a 500.

In create-mode the actor has full edit authority over the form they are
filling in (the create-authorize gate has already passed), so set
$canUpdateTenant = true before requiring _form.phtml. Mirrors the value
that edit($id).php derives from the EDIT_CONTEXT capabilities map.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 10:05:42 +02:00

57 lines
1.6 KiB
PHTML

<?php
/**
* @var array<int, string> $errors
* @var array $form
* @var bool $canManageCustomFields
* @var bool $canManageSso
*/
?>
<div class="app-details-container">
<section>
<?php
$titlebar = [
'title' => t('Create tenant'),
'backHref' => 'admin/tenants',
'backTitle' => t('Cancel'),
'actions' => [
[
'form' => 'tenant-form',
'name' => 'action',
'value' => 'create',
'class' => 'secondary outline',
'label' => t('Create'),
],
[
'form' => 'tenant-form',
'name' => 'action',
'value' => 'create_close',
'class' => 'primary',
'label' => t('Create & close'),
],
],
];
require templatePath('partials/app-details-titlebar.phtml');
?>
<?php
$validationSummaryErrors = $validationSummaryErrors ?? ($errors ?? []);
require templatePath('partials/app-details-validation-summary.phtml');
?>
<?php
$values = $form ?? [];
$detailsOpenAll = true;
$showCustomFieldsTab = (bool) ($canManageCustomFields ?? false);
$showSsoTab = (bool) ($canManageSso ?? false);
$customFieldTenantUuid = '';
$customFieldDefinitions = [];
$ignoreTabStorage = true;
// In create-mode the actor has full edit authority over the form they
// are filling in; the shared _form.phtml partial reads $canUpdateTenant
// for the logo/favicon upload blocks introduced in commit 6e3fc63c.
$canUpdateTenant = true;
require __DIR__ . '/_form.phtml';
?>
</section>
</div>