Skip to content

Commit 0ffaeec

Browse files
committed
Merge branch '4.15' into feature/cms-1373-warn-when-moving-large-asset-folders
2 parents 063958f + ce7f97b commit 0ffaeec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+893
-153
lines changed

CHANGELOG-WIP.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Release Notes for Craft CMS 4.15 (WIP)
2+
3+
### Content Management
4+
- Window scrolling is now blocked when a modal window is open. ([#16768](https://github.com/craftcms/cms/pull/16768))
5+
6+
### Administration
7+
- Added the `db/repair` command. ([#16812](https://github.com/craftcms/cms/pull/16812))
8+
- Added the `--batch-size` option for `resave/*` commands. ([#16586](https://github.com/craftcms/cms/issues/16586))
9+
- The `users/create` command now prompts to send an activation email, or outputs an activation URL. ([#16794](https://github.com/craftcms/cms/pull/16794))
10+
- Dragging headings within the Customize Sources modal now also drags any subsequent sources. ([#16737](https://github.com/craftcms/cms/issues/16737))
11+
- When switching field types, any field settings which are defined by the same base class are now preserved. ([#16783](https://github.com/craftcms/cms/pull/16783))
12+
13+
### Extensibility
14+
- Global nav items and breadcrumbs can now have `aria-label` attributes via an `ariaLabel` property.
15+
- Added `craft\base\ElementInterface::getSerializedFieldValuesForDb()`.
16+
- Added `craft\base\FieldInterface::serializeValueForDb()`.
17+
- Added `craft\db\Connection::getIsMaria()`.
18+
- Added `craft\db\Table::SEARCHINDEXQUEUE_FIELDS`.
19+
- Added `craft\db\Table::SEARCHINDEXQUEUE`.
20+
- Added `craft\db\mysql\QueryBuilder::jsonContains()`.
21+
- Added `craft\db\mysql\QueryBuilder::jsonExtract()`.
22+
- Added `craft\db\pgsql\QueryBuilder::jsonContains()`.
23+
- Added `craft\db\pgsql\QueryBuilder::jsonExtract()`.
24+
- Added `craft\queue\ReleasableQueueInterface`. ([#16672](https://github.com/craftcms/cms/pull/16672))
25+
- Added `craft\records\User::haveIndexAttributesChanged()`.
26+
- Added `craft\services\Search::indexElementIfQueued()`.
27+
- Added `craft\services\Search::queueIndexElement()`.
28+
- `craft\cache\ElementQueryTagDependency` now merges cache tags provided by the element query with any tags already set on its `$tags` property.
29+
30+
### System
31+
- `craft\queue\Queue::release()` and `releaseAll()` now call `release()` and `releaseAll()` on the proxied queue if it implements `craft\queue\ReleasableQueueInterface`. ([#16672](https://github.com/craftcms/cms/pull/16672))
32+
- The `changedattributes` and `changedfields` tables are now cleaned up during garbage collection. ([#16531](https://github.com/craftcms/cms/pull/16531))
33+
- The `resourcepaths` table is now truncated when clearing control panel resources, via the Caches utility or the `clear-caches/cp-resources` command. ([#16514](https://github.com/craftcms/cms/issues/16514))
34+
- Date values for custom fields are now represented as ISO-8601 date strings (with time zones) within element exports. ([#16629](https://github.com/craftcms/cms/pull/16629))
35+
- “Updating search indexes” queue jobs no longer do anything if search indexes were already updated for the element since the job was created. ([#16644](https://github.com/craftcms/cms/pull/16644))
36+
- User caches are no longer invalidated on login attempts or when user management actions are taken. ([#16937](https://github.com/craftcms/cms/pull/16937))
37+
- Updated Yii to 2.0.52.
38+
- Updated yii2-debug to 2.1.26.

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22

33
## Unreleased
44

5+
- Fixed a bug where relations weren’t always propagating to newly-added sites for sections correctly. ([#16924](https://github.com/craftcms/cms/pull/16924))
6+
7+
## 4.14.11.1 - 2025-03-19
8+
9+
- Fixed a performance degradation bug that occurred when working with Categories or Entries fields with “Maintain hierarchy” enabled. ([#16920](https://github.com/craftcms/cms/issues/16920))
10+
11+
## 4.14.11 - 2025-03-18
12+
513
- Fixed a bug where relational fields with “Maintain hierarchy” enabled weren’t displaying the correct relations after an element was moved within its structure. ([#16843](https://github.com/craftcms/cms/issues/16843))
614
- Fixed a bug where letterbox transforms were getting transparent fills if the source image was grayscale. ([#16857](https://github.com/craftcms/cms/issues/16857))
715
- Fixed a bug where elements could be missing data for attributes that shared a name with an eager-loadable attribute from another element type. ([#16862](https://github.com/craftcms/cms/issues/16862))
816
- Fixed a bug where Selectize inputs would re-expand themselves after a selection was made. ([#16865](https://github.com/craftcms/cms/pull/16865))
17+
- Fixed a bug where entry revisions’ `revisionNotes` GraphQL fields were returning the entry’s current revision’s notes. ([#16909](https://github.com/craftcms/cms/issues/16909))
918

1019
## 4.14.10 - 2025-03-04
1120

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"twig/twig": "~3.15.0",
5757
"voku/stringy": "^6.4.0",
5858
"webonyx/graphql-php": "~14.11.5",
59-
"yiisoft/yii2": "~2.0.51.0",
60-
"yiisoft/yii2-debug": "~2.1.25.0",
59+
"yiisoft/yii2": "~2.0.52.0",
60+
"yiisoft/yii2-debug": "~2.1.26.0",
6161
"yiisoft/yii2-queue": "~2.3.2",
6262
"yiisoft/yii2-symfonymailer": "^2.0.0"
6363
},
@@ -78,8 +78,8 @@
7878
"provide": {
7979
"bower-asset/inputmask": "5.0.9",
8080
"bower-asset/jquery": "3.6.1",
81-
"bower-asset/punycode": "2.3.1",
82-
"bower-asset/yii2-pjax": "2.0.8",
81+
"bower-asset/punycode": "^1.4",
82+
"bower-asset/yii2-pjax": "~2.0.1",
8383
"yii2tech/ar-softdelete": "1.0.4"
8484
},
8585
"conflict": {

composer.lock

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crowdin.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ files:
1212
- el
1313
- hr
1414
- id
15-
- is
1615
- ky
1716
commit_message: '[ci skip]'

src/base/Element.php

+27-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use craft\behaviors\CustomFieldBehavior;
1313
use craft\behaviors\DraftBehavior;
1414
use craft\behaviors\RevisionBehavior;
15+
use craft\cache\ElementQueryTagDependency;
1516
use craft\db\Connection;
1617
use craft\db\ExcludeDescendantIdsExpression;
1718
use craft\db\Query;
@@ -73,6 +74,7 @@
7374
use craft\validators\SlugValidator;
7475
use craft\validators\StringValidator;
7576
use craft\web\UploadedFile;
77+
use DateTime;
7678
use Illuminate\Support\Collection;
7779
use Throwable;
7880
use Traversable;
@@ -1186,8 +1188,13 @@ public static function indexHtml(ElementQueryInterface $elementQuery, ?array $di
11861188
}
11871189

11881190
// Only cache if there's no search term
1189-
if (!$elementQuery->search) {
1190-
$elementQuery->cache();
1191+
if ($elementQuery instanceof ElementQuery && !$elementQuery->search) {
1192+
$elementQuery->cache(dependency: new ElementQueryTagDependency($elementQuery, [
1193+
'tags' => [
1194+
'element-index-query',
1195+
sprintf('element-index-query::%s', static::class),
1196+
],
1197+
]));
11911198
}
11921199

11931200
$variables['elements'] = static::indexElements($elementQuery, $sourceKey);
@@ -2540,7 +2547,7 @@ public function afterValidate(): void
25402547

25412548
if ($field::hasContentColumn()) {
25422549
$columnType = $field->getContentColumnType();
2543-
$value = $field->serializeValue($this->getFieldValue($field->handle), $this);
2550+
$value = $field->serializeValueForDb($this->getFieldValue($field->handle), $this);
25442551

25452552
if (is_array($columnType)) {
25462553
foreach ($columnType as $key => $type) {
@@ -4214,6 +4221,23 @@ public function getSerializedFieldValues(?array $fieldHandles = null): array
42144221
return $serializedValues;
42154222
}
42164223

4224+
/**
4225+
* @inheritdoc
4226+
*/
4227+
public function getSerializedFieldValuesForDb(?array $fieldHandles = null): array
4228+
{
4229+
$serializedValues = [];
4230+
4231+
foreach ($this->fieldLayoutFields() as $field) {
4232+
if ($fieldHandles === null || in_array($field->handle, $fieldHandles, true)) {
4233+
$value = $this->getFieldValue($field->handle);
4234+
$serializedValues[$field->handle] = $field->serializeValueForDb($value, $this);
4235+
}
4236+
}
4237+
4238+
return $serializedValues;
4239+
}
4240+
42174241
/**
42184242
* @inheritdoc
42194243
*/

src/base/ElementInterface.php

+12
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,18 @@ public function getFieldValues(?array $fieldHandles = null): array;
13791379
*/
13801380
public function getSerializedFieldValues(?array $fieldHandles = null): array;
13811381

1382+
/**
1383+
* Returns an array of the element’s serialized custom field values, indexed by their handles,
1384+
* for database storage.
1385+
*
1386+
* @param string[]|null $fieldHandles The list of field handles whose values
1387+
* need to be returned. Defaults to null, meaning all fields’ values will be
1388+
* returned. If it is an array, only the fields in the array will be returned.
1389+
* @return array
1390+
* @since 4.15.0
1391+
*/
1392+
public function getSerializedFieldValuesForDb(?array $fieldHandles = null): array;
1393+
13821394
/**
13831395
* Sets the element’s custom field values.
13841396
*

src/base/Field.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -643,12 +643,25 @@ public function serializeValue(mixed $value, ?ElementInterface $element = null):
643643

644644
// Only DateTime objects and ISO-8601 strings should automatically be detected as dates
645645
if ($value instanceof DateTime || DateTimeHelper::isIso8601($value)) {
646-
return Db::prepareDateForDb($value);
646+
return DateTimeHelper::toIso8601($value);
647647
}
648648

649649
return $value;
650650
}
651651

652+
/**
653+
* @inheritdoc
654+
*/
655+
public function serializeValueForDb(mixed $value, ElementInterface $element): mixed
656+
{
657+
// Dates should be stored in UTC w/o the time zone
658+
if ($value instanceof DateTime || DateTimeHelper::isIso8601($value)) {
659+
return Db::prepareDateForDb($value);
660+
}
661+
662+
return $this->serializeValue($value, $element);
663+
}
664+
652665
/**
653666
* @inheritdoc
654667
*/

src/base/FieldInterface.php

+14-2
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,8 @@ public function normalizeValue(mixed $value, ?ElementInterface $element = null):
393393
public function normalizeValueFromRequest(mixed $value, ?ElementInterface $element = null): mixed;
394394

395395
/**
396-
* Prepares the field’s value to be stored somewhere, like the content table.
396+
* Serializes the field’s value into a transportable format (either a scalar value or array of scalar values).
397397
*
398-
* Data types that are JSON-encodable are safe (arrays, integers, strings, booleans, etc).
399398
* Whatever this returns should be something [[normalizeValue()]] can handle.
400399
*
401400
* @param mixed $value The raw field value
@@ -404,6 +403,19 @@ public function normalizeValueFromRequest(mixed $value, ?ElementInterface $eleme
404403
*/
405404
public function serializeValue(mixed $value, ?ElementInterface $element = null): mixed;
406405

406+
/**
407+
* Serializes the field’s value into a transportable format (either a scalar value or array of scalar values),
408+
* for database storage.
409+
*
410+
* Whatever this returns should be something [[normalizeValue()]] can handle.
411+
*
412+
* @param mixed $value
413+
* @param ElementInterface $element
414+
* @return mixed
415+
* @since 4.15.0
416+
*/
417+
public function serializeValueForDb(mixed $value, ElementInterface $element): mixed;
418+
407419
/**
408420
* Copies the field’s value from one element to another.
409421
*

0 commit comments

Comments
 (0)