Skip to content

Commit

Permalink
Merge branch 'release/4.4.5' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Mar 21, 2023
2 parents bee9366 + 536f726 commit 4adcbee
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 31 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release Notes for Craft CMS 4

## 4.4.5 - 2023-03-21

- Fixed a bug where relation data was getting deleted when running garbage collection on PostgreSQL. ([#9905](https://github.com/craftcms/cms/issues/9905))
- Fixed a bug where Lightswitch fields’ “OFF Label” and “ON Label” settings weren’t getting translated. ([#12942](https://github.com/craftcms/cms/issues/12942))
- Fixed a bug where `craft\events\DefineUserContentSummaryEvent::$userId` was never set for `craft\controllers\EVENT_DEFINE_CONTENT_SUMMARY` events. ([#12944](https://github.com/craftcms/cms/issues/12944))
- Fixed a bug where element edit pages weren’t displaying layout tabs that didn’t have a unique name. ([#12928](https://github.com/craftcms/cms/issues/12928))
- Fixed a bug where the `CRAFT_LOG_PHP_ERRORS` constant/environment variable wasn’t being respected when set to `false`. ([#12862](https://github.com/craftcms/cms/issues/12862))
- Fixed a bug where the `entrify/categories` command wasn’t converting disabled categories. ([#12945](https://github.com/craftcms/cms/issues/12945))
- Updated svg-sanitizer to 0.16. ([#12943](https://github.com/craftcms/cms/issues/12943))

## 4.4.4 - 2023-03-20

- Input autofocussing has been reintroduced throughout the control panel. ([#12921](https://github.com/craftcms/cms/discussions/12921))
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}

// Log errors to storage/logs/phperrors.log or php://stderr
if (!App::parseBooleanEnv('$CRAFT_LOG_PHP_ERRORS')) {
if (App::parseBooleanEnv('$CRAFT_LOG_PHP_ERRORS') !== false) {
ini_set('log_errors', '1');

if (App::isStreamLog()) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"craftcms/server-check": "~2.1.2",
"creocoder/yii2-nested-sets": "~0.9.0",
"elvanto/litemoji": "^4.3.0",
"enshrined/svg-sanitize": "~0.15.0",
"enshrined/svg-sanitize": "~0.16.0",
"guzzlehttp/guzzle": "^7.2.0",
"illuminate/collections": "^9.1.0",
"league/oauth2-client": "^2.6.0",
Expand Down
81 changes: 65 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/config/GeneralConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ class GeneralConfig extends BaseConfig
* This can also be set to `'*'` to disable **all** plugins.
*
* ```php
* ->disabledPlugins'('*')
* ->disabledPlugins('*')
* ```
*
* ::: warning
Expand Down
2 changes: 1 addition & 1 deletion src/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
'id' => 'CraftCMS',
'name' => 'Craft CMS',
'version' => '4.4.4',
'version' => '4.4.5',
'schemaVersion' => '4.4.0.4',
'minVersionRequired' => '3.7.11',
'basePath' => dirname(__DIR__), // Defines the @app alias
Expand Down
6 changes: 4 additions & 2 deletions src/console/controllers/EntrifyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public function actionCategories(string $categoryGroup): int
$this->stdout(PHP_EOL);

$categoryQuery = Category::find()
->group($categoryGroup);
->group($categoryGroup)
->status(null);

if ($categoryGroup->dateDeleted) {
$categoryQuery
Expand Down Expand Up @@ -335,7 +336,8 @@ public function actionTags(string $tagGroup): int
}

$tagQuery = Tag::find()
->group($tagGroup);
->group($tagGroup)
->status(null);

if ($tagGroup->dateDeleted) {
$tagQuery
Expand Down
13 changes: 10 additions & 3 deletions src/controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1796,9 +1796,15 @@ public function actionUserContentSummary(): Response
{
$this->requirePostRequest();

$userIds = $this->request->getRequiredBodyParam('userId');
$userId = $this->request->getRequiredBodyParam('userId');

if (is_array($userId)) {
$userId = array_map(fn($id) => (int)$id, $userId);
} else {
$userId = (int)$userId;
}

if ($userIds !== (string)static::currentUser()->id) {
if ($userId !== static::currentUser()?->id) {
$this->requirePermission('deleteUsers');
}

Expand All @@ -1807,7 +1813,7 @@ public function actionUserContentSummary(): Response
foreach (Craft::$app->getSections()->getAllSections() as $section) {
$entryCount = Entry::find()
->sectionId($section->id)
->authorId($userIds)
->authorId($userId)
->site('*')
->unique()
->status(null)
Expand All @@ -1823,6 +1829,7 @@ public function actionUserContentSummary(): Response

// Fire a 'defineUserContentSummary' event
$event = new DefineUserContentSummaryEvent([
'userId' => $userId,
'contentSummary' => $summary,
]);
$this->trigger(self::EVENT_DEFINE_CONTENT_SUMMARY, $event);
Expand Down
4 changes: 2 additions & 2 deletions src/fields/Lightswitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ protected function inputHtml(mixed $value, ?ElementInterface $element = null): s
'describedBy' => $this->describedBy,
'name' => $this->handle,
'on' => (bool)$value,
'onLabel' => $this->onLabel,
'offLabel' => $this->offLabel,
'onLabel' => Craft::t('site', $this->onLabel),
'offLabel' => Craft::t('site', $this->offLabel),
]);
}

Expand Down
5 changes: 4 additions & 1 deletion src/models/FieldLayoutTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,11 @@ public function getHtmlId(): string
$asciiName = sprintf('tab-%s', md5($this->name));
}

// ensure unique tab id even if there are multiple tabs with the same name
$tabOrder = StringHelper::pad((string)$this->sortOrder, 2, '0', 'left');

// Use two dashes here in case a tab name starts with “Tab”
return "tab--$asciiName";
return "tab$tabOrder--$asciiName";
}

/**
Expand Down
10 changes: 7 additions & 3 deletions src/services/Gc.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ private function _deleteOrphanedRelations(): void
DELETE FROM $relationsTable
USING $relationsTable [[r]]
LEFT JOIN $elementsTable [[e]] ON [[e.id]] = [[r.targetId]]
WHERE [[e.id]] IS NULL
WHERE
$relationsTable.[[id]] = [[r.id]] AND
[[e.id]] IS NULL
SQL;
}

Expand All @@ -498,8 +500,10 @@ private function _deleteOrphanedStructureElements(): void
DELETE FROM $structureElementsTable
USING $structureElementsTable [[se]]
LEFT JOIN $elementsTable [[e]] ON [[e.id]] = [[se.elementId]]
WHERE $structureElementsTable.[[id]] = [[se.id]] AND
[[se.elementId]] IS NOT NULL AND [[e.id]] IS NULL
WHERE
$structureElementsTable.[[id]] = [[se.id]] AND
[[se.elementId]] IS NOT NULL AND
[[e.id]] IS NULL
SQL;
}

Expand Down

0 comments on commit 4adcbee

Please sign in to comment.