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

4.15 #16490

Draft
wants to merge 163 commits into
base: 5.x
Choose a base branch
from
Draft

4.15 #16490

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
2e0f00b
New translations app.php (Thai)
shinybrad Jan 22, 2025
f7b6aa5
New translations app.php (Thai)
shinybrad Jan 22, 2025
d5fea72
New translations app.php (Dutch)
shinybrad Jan 22, 2025
09aea31
New translations app.php (Thai)
shinybrad Jan 22, 2025
2eb222c
remove invisible Unicode special characters from search keywords
i-just Jan 22, 2025
6f12622
adjust tests
i-just Jan 22, 2025
1263a19
New translations app.php (German, Switzerland)
shinybrad Jan 22, 2025
b7b73b5
New translations app.php (Thai)
shinybrad Jan 22, 2025
6388527
Prep 4.15 release notes
brandonkelly Jan 22, 2025
8f28308
New translations app.php (Thai)
shinybrad Jan 22, 2025
1e4fb94
Merge pull request #16477 from craftcms/t9n/4.x
brandonkelly Jan 22, 2025
9723e16
Merge branch '4.x' into bugfix/16457-unicode-special-chars-and-search
brandonkelly Jan 22, 2025
cbd337e
Cleanup
brandonkelly Jan 22, 2025
0b1283c
Release note
brandonkelly Jan 22, 2025
76b8643
Merge pull request #16483 from craftcms/bugfix/16457-unicode-special-…
brandonkelly Jan 22, 2025
7fe604f
Typo
brandonkelly Jan 22, 2025
95f92e4
Finish 4.14.1
brandonkelly Jan 23, 2025
2455dcf
New translations app.php (Thai)
shinybrad Jan 23, 2025
f167c56
New translations app.php (Thai)
shinybrad Jan 23, 2025
962e22e
New translations app.php (Thai)
shinybrad Jan 23, 2025
baa4cb1
New translations app.php (Thai)
shinybrad Jan 23, 2025
9f81f01
New translations app.php (Thai)
shinybrad Jan 23, 2025
8a12e4f
New translations app.php (Thai)
shinybrad Jan 23, 2025
12955b4
Fixed #16506
brandonkelly Jan 24, 2025
696dedb
Merge branch '4.x' into 4.15
brandonkelly Jan 25, 2025
012b965
Stop showing outdated attribute statuses for anything besides derivat…
brandonkelly Jan 25, 2025
56fcdaf
Merge branch '4.x' into 4.15
brandonkelly Jan 25, 2025
950a1dc
Delete pointless change data via GC
brandonkelly Jan 25, 2025
f7db48e
Release note
brandonkelly Jan 25, 2025
e83eccf
$transportAdapter is null here
brandonkelly Jan 25, 2025
e568e90
Merge pull request #16531 from craftcms/feature/less-changedfields
brandonkelly Jan 25, 2025
97baca5
Merge branch '4.x' into 4.15
brandonkelly Jan 25, 2025
45c09e5
Don't create ID cache tags if > 100 IDs
brandonkelly Jan 25, 2025
1391897
Merge pull request #16498 from craftcms/t9n/4.x
brandonkelly Jan 26, 2025
8c82495
Merge branch '4.x' into 4.15
brandonkelly Jan 26, 2025
37fdca9
Truncate the resourcepaths table
brandonkelly Jan 26, 2025
a61840f
Fixed mergeCanonicalChanges() for Matrix sub-fields
brandonkelly Jan 26, 2025
514d28d
when propagating element, cross site validate if we're changing the s…
i-just Jan 27, 2025
01869ca
ensure the db connection is closed before transaction events are regi…
joshuapease Jan 27, 2025
9058914
Exclude normal drafts too
brandonkelly Jan 27, 2025
dbef44d
Release note
brandonkelly Jan 27, 2025
b7fad82
Merge pull request #16533 from craftcms/bugfix/16505-crossvalidate-wh…
brandonkelly Jan 27, 2025
6e6d53f
Merge branch '4.x' into test-db-connection-fix
brandonkelly Jan 27, 2025
bd21abd
Release note
brandonkelly Jan 27, 2025
e7ac8ab
Remove ʻokina characters along with other punctuation
brandonkelly Jan 28, 2025
9ab9310
Make PHPStan happy
brandonkelly Jan 28, 2025
22c4b16
Finish 4.14.2
brandonkelly Jan 28, 2025
2f42a4a
Merge branch '4.x' into 4.15
brandonkelly Jan 29, 2025
1a95ee7
refactor: make test integration compatible with newer versions of `co…
Jan 29, 2025
a41444a
Fixed #16579
brandonkelly Jan 29, 2025
e716c71
Merge pull request #16580 from qrazi/patch_16577
brandonkelly Jan 29, 2025
8a01737
Release note for #16580
brandonkelly Jan 29, 2025
c3812c7
Don't filter out excluded descendants when checking for descendants
brandonkelly Jan 29, 2025
8d4bc53
Finish 4.14.3
brandonkelly Jan 29, 2025
34b7aba
Merge branch '4.x' into 4.15
brandonkelly Jan 30, 2025
5199f6e
--batch-size option for resave/* commands
brandonkelly Jan 30, 2025
c125954
Support for aria-label on nav items
brandonkelly Jan 30, 2025
253d692
Handle redirect responses
brandonkelly Jan 30, 2025
3cc4e46
New translations app.php (Norwegian Bokmal)
shinybrad Jan 31, 2025
c3d0116
Merge pull request #16612 from craftcms/t9n/4.x
brandonkelly Jan 31, 2025
493dea2
Index section queries using the actual query name
brandonkelly Jan 31, 2025
60048ef
New translations app.php (Dutch)
shinybrad Feb 1, 2025
02a07b9
Merge pull request #16615 from craftcms/t9n/4.x
brandonkelly Feb 1, 2025
c7f9eb7
Merge branch '4.x' into 4.15
brandonkelly Feb 2, 2025
9bbd9e7
Fixed #16622
brandonkelly Feb 3, 2025
76e679d
Throw install exceptions
brandonkelly Feb 4, 2025
d49bfbb
in expanded export, custom date fields should be exported in system's…
i-just Feb 4, 2025
d59fcb6
Check from the other end too, in case height was the provided dimension
brandonkelly Feb 4, 2025
bcd2cc0
Cleanup
brandonkelly Feb 4, 2025
c2ebc39
Merge branch '4.x' into 4.15
brandonkelly Feb 4, 2025
9a2735f
Merge branch '4.15' into bugfix/16588-expanded-export-custom-date-fields
brandonkelly Feb 4, 2025
2a03181
serializeValueForDb() + cleanup
brandonkelly Feb 4, 2025
b05ad00
Release notes
brandonkelly Feb 4, 2025
24ec92c
Merge pull request #16629 from craftcms/bugfix/16588-expanded-export-…
brandonkelly Feb 4, 2025
239d448
$element is always set
brandonkelly Feb 4, 2025
469b3fc
Finish 4.14.4
brandonkelly Feb 4, 2025
6ced28f
Merge branch '4.x' into 4.15
brandonkelly Feb 4, 2025
db8a2cb
Don't allow URLs in username
timkelty Feb 5, 2025
28228cb
Merge branch '4.x' into feature/disallow-url-as-username
brandonkelly Feb 5, 2025
2c2d46e
Release note
brandonkelly Feb 5, 2025
bb22806
Merge pull request #16633 from craftcms/feature/disallow-url-as-username
brandonkelly Feb 5, 2025
56a1ae7
Fixed redundant search indexing
brandonkelly Feb 6, 2025
227b6d1
Merge branch '4.x' into 4.15
brandonkelly Feb 6, 2025
93199c1
Search index queue
brandonkelly Feb 6, 2025
f76a651
Release notes
brandonkelly Feb 6, 2025
1b42f28
Merge pull request #16644 from craftcms/feature/cms-109-search-index-…
brandonkelly Feb 6, 2025
1ba22da
Backport 14c56d0d6ba06e17c6316ee151fbcd8dc0eacd0c
brandonkelly Jan 23, 2025
526e502
Merge branch '4.x' into 4.15
brandonkelly Feb 7, 2025
3c692b4
force save all when owner has new site ids
i-just Feb 7, 2025
fbe700f
Don't modify passed-in deltaNames & modifiedDeltaNames arrays
brandonkelly Feb 8, 2025
fbe39db
Check for Response when deleting a draft
brandonkelly Feb 8, 2025
37eb8b8
when duplicating find dynamic folder by canonical of duplicateOf element
i-just Feb 10, 2025
1f4682b
respect selected transform position
i-just Feb 10, 2025
c0cea50
Synchronize job releasing to proxyQueue
timkelty Feb 10, 2025
d166595
CustomFieldBehavior header URLs
AugustMiller Feb 7, 2025
b9acb5d
Correct link in mailer docblock
AugustMiller Feb 4, 2025
42125bd
Merge branch '4.x' into bugfix/assets-field-dynamic-subpath-and-struc…
brandonkelly Feb 11, 2025
08c265a
Release note
brandonkelly Feb 11, 2025
8a6331f
Merge pull request #16661 from craftcms/bugfix/assets-field-dynamic-s…
brandonkelly Feb 11, 2025
0edf431
Merge branch '4.x' into bugfix/16648-image-transform-position
brandonkelly Feb 11, 2025
0f3c28c
Release notes
brandonkelly Feb 11, 2025
dc9d864
Merge pull request #16665 from craftcms/bugfix/16648-image-transform-…
brandonkelly Feb 11, 2025
3794d6f
Force check for pending project config changes when appropriate
brandonkelly Feb 11, 2025
9fe6147
Fixed condition rules losing their condition when being created
nfourtythree Feb 11, 2025
270fa8c
changelog
nfourtythree Feb 11, 2025
16463a1
Merge branch '4.x' into 4.15
brandonkelly Feb 11, 2025
af6a52e
Merge branch '4.15' into bugfix/sync-release-to-proxy-queue
brandonkelly Feb 11, 2025
b87a627
Release note tweaks & move to the WIP changelog
brandonkelly Feb 11, 2025
350042d
Cleanup
brandonkelly Feb 11, 2025
47733dd
Merge pull request #16672 from craftcms/bugfix/sync-release-to-proxy-…
brandonkelly Feb 11, 2025
188a742
Release note tweak
brandonkelly Feb 11, 2025
ad72556
Merge pull request #16676 from craftcms/bugfix/condition-rule-creatio…
brandonkelly Feb 11, 2025
8668c20
Fixed #16678
brandonkelly Feb 11, 2025
f779db3
Finish 4.14.5
brandonkelly Feb 12, 2025
1fe4b14
on activation, clear out events so they don't stack up
i-just Feb 13, 2025
6e0f143
catch FsException too; don't delete asset from old volume prematurely
i-just Feb 14, 2025
93dba72
track folders with failed asset moves and don't delete them
i-just Feb 14, 2025
783908e
build
i-just Feb 14, 2025
baf38cc
search for canonical parent id in any site
i-just Feb 14, 2025
088c974
don't set explicit width and height for the datepicker
i-just Feb 14, 2025
0b62d13
set a bit smaller meta input width
i-just Feb 14, 2025
1147a9d
Merge branch '4.x' into 4.15
brandonkelly Feb 14, 2025
f386ce9
Yii 2.0.52
brandonkelly Feb 14, 2025
f5ba868
Release note
brandonkelly Feb 14, 2025
bef5049
Merge pull request #16693 from craftcms/bugfix/16688-replace-file-not…
brandonkelly Feb 14, 2025
032d500
Be defensive about disabling FK checks
brandonkelly Feb 14, 2025
757ce84
Merge branch '4.x' of https://github.com/craftcms/cms into 4.x
brandonkelly Feb 14, 2025
4b4b7aa
Merge pull request #16708 from craftcms/yii-2-0-52
brandonkelly Feb 14, 2025
f2543fb
Merge branch '4.x' into 4.15
brandonkelly Feb 14, 2025
d946009
Release note for #16708
brandonkelly Feb 14, 2025
ca45e89
Merge branch '4.x' into bugfix/16697-datepicker-size
brandonkelly Feb 14, 2025
4817e23
Release note
brandonkelly Feb 14, 2025
c32769d
Merge pull request #16705 from craftcms/bugfix/16697-datepicker-size
brandonkelly Feb 14, 2025
fba0b6a
Merge branch '4.x' into bugfix/16686-moving-assets-between-volumes
brandonkelly Feb 14, 2025
f83f988
Release note
brandonkelly Feb 14, 2025
ad4804c
Merge pull request #16701 from craftcms/bugfix/16686-moving-assets-be…
brandonkelly Feb 14, 2025
4026d55
Merge branch '4.x' into bugfix/16691-parents-and-non-primary-sites
brandonkelly Feb 16, 2025
5c85c92
Release note
brandonkelly Feb 16, 2025
223d8eb
Merge pull request #16703 from craftcms/bugfix/16691-parents-and-non-…
brandonkelly Feb 16, 2025
f171f5e
Merge branch '4.x' into bugfix/16699-meta-input-size
brandonkelly Feb 16, 2025
a8282e7
Release note
brandonkelly Feb 16, 2025
ae2e5f1
Merge pull request #16706 from craftcms/bugfix/16699-meta-input-size
brandonkelly Feb 16, 2025
8fee0fd
Fixed #16709
brandonkelly Feb 16, 2025
8ea2b89
Merge branch '4.x' into 4.15
brandonkelly Feb 16, 2025
a7e1d83
Handle semi-numeric strings
brandonkelly Feb 17, 2025
47f89fb
Merge branch '4.x' into 4.15
brandonkelly Feb 17, 2025
66be882
Fixed #16721
brandonkelly Feb 18, 2025
bbadcbd
Finish 4.14.6
brandonkelly Feb 18, 2025
22932dc
Merge branch '4.x' into 4.15
brandonkelly Feb 18, 2025
fad93b1
Don't assume getAncestors() returns an element query
brandonkelly Feb 19, 2025
f9530f0
Include disabled ancestors in breadcrumbs
brandonkelly Feb 19, 2025
b989c5c
Include disabled descendants
brandonkelly Feb 19, 2025
d698034
Only delete the old file if its location actually changed
brandonkelly Feb 19, 2025
90b16d9
Finish 4.14.7
brandonkelly Feb 19, 2025
83dda3d
Merge branch '4.x' into 4.15
brandonkelly Feb 20, 2025
cc545a1
Drag heading + subsequent sources
brandonkelly Feb 20, 2025
a69ab16
Drag cleanup + fixes
brandonkelly Feb 20, 2025
79f557f
🙈
brandonkelly Feb 20, 2025
99b58d4
Backport 3762f4ba3c3c211decb8c74e909d98b23d2ad223
brandonkelly Feb 20, 2025
40fc7da
Finish 4.14.8
brandonkelly Feb 20, 2025
34ff6e4
4.14.8.1 - Fix Field::afterSave()
brandonkelly Feb 21, 2025
cba6d8e
Fix deferPublicRegistrationPassword docs
brandonkelly Feb 21, 2025
9efd014
Merge branch '4.x' into 4.15
brandonkelly Feb 21, 2025
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
23 changes: 23 additions & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Release Notes for Craft CMS 4.15 (WIP)

### Administration
- Added the `--batch-size` option for `resave/*` commands. ([#16586](https://github.com/craftcms/cms/issues/16586))
- Dragging headings within the Customize Sources modal now also drags any subsequent sources. ([#16737](https://github.com/craftcms/cms/issues/16737))

### Extensibility
- Global nav items and breadcrumbs can now have `aria-label` attributes via an `ariaLabel` property.
- Added `craft\base\ElementInterface::getSerializedFieldValuesForDb()`.
- Added `craft\base\FieldInterface::serializeValueForDb()`.
- Added `craft\db\Table::SEARCHINDEXQUEUE_FIELDS`.
- Added `craft\db\Table::SEARCHINDEXQUEUE`.
- Added `craft\queue\ReleasableQueueInterface`. ([#16672](https://github.com/craftcms/cms/pull/16672))
- Added `craft\services\Search::indexElementIfQueued()`.
- Added `craft\services\Search::queueIndexElement()`.

### System
- `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))
- The `changedattributes` and `changedfields` tables are now cleaned up during garbage collection. ([#16531](https://github.com/craftcms/cms/pull/16531))
- 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))
- 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))
- “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))
- Updated Yii to 2.0.52.
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Release Notes for Craft CMS 4

## 4.14.8.1 - 2025-02-20

- Fixed a bug where newly-created custom fields wouldn’t have their full settings intact for `afterSave()`.

## 4.14.8 - 2025-02-20

- Fixed a bug where scrollable panes weren’t automatically scrolling when dragging objects near their edges. ([#16738](https://github.com/craftcms/cms/issues/16738))
- Fixed a bug where “Applying new propagation method to [Field Name] entries” jobs weren’t getting queued when deploying changes to Matrix fields’ Propagation Method settings. ([#16740](https://github.com/craftcms/cms/issues/16740))

## 4.14.7 - 2025-02-19

- Added `craft\base\Element::ancestors()`.
- Added `craft\base\Element::descendants()`.
- Fixed an error that occurred when deleting a category or Structure section entry if its ancestors were eager-loaded. ([#16722](https://github.com/craftcms/cms/issues/16722))
- Fixed a bug where category and entry edit pages didn’t include breadcrumbs for any disabled ancestor elements.
- Fixed a bug where the “Delete (with descendants)” bulk element action wasn’t deleting disabled descendants.
- Fixed a bug where asset files could be deleted when modified. ([#16686](https://github.com/craftcms/cms/issues/16686))

## 4.14.6 - 2025-02-18

- Fixed a bug where multiple “New file uploaded.” notifications could be shown at once. ([#16688](https://github.com/craftcms/cms/issues/16688))
- Fixed an error that could occur during garbage collection if the database user didn’t have permission to disable foreign key constraints. ([#16700](https://github.com/craftcms/cms/issues/16700))
- Fixed a bug where datepickers could have scrollbars. ([#16697](https://github.com/craftcms/cms/issues/16697))
- Fixed a bug where asset files could be prematurely deleted when moved to a different volume, if an error occurred. ([#16686](https://github.com/craftcms/cms/issues/16686))
- Fixed a bug where clearing out a Structure section’s Parent field wasn’t persisting if editing the entry for a newly-added site. ([#16691](https://github.com/craftcms/cms/issues/16691))
- Fixed a bug where SVG asset transforms could get two `preserveAspectRatio` attributes. ([#16709](https://github.com/craftcms/cms/issues/16709))
- Fixed a bug where Number fields weren’t handling semi-numeric strings properly. ([craftcms/feed-me#1575](https://github.com/craftcms/feed-me/issues/1575))
- Fixed styling issues. ([#16699](https://github.com/craftcms/cms/issues/16699), [#16721](https://github.com/craftcms/cms/issues/16721))

## 4.14.5 - 2025-02-11

- Fixed a bug where multi-site elements’ search indexes could be updated twice.
- Fixed a bug where the `utils/delete-empty-volume-folders` command was deleting folders that had no assets directly, but had subfolders. ([#16388](https://github.com/craftcms/cms/issues/16388))
- Fixed a bug where some Matrix blocks weren’t getting propagated to newly-added sites of their owners, if any blocks had been modified. ([#16640](https://github.com/craftcms/cms/issues/16640))
- Fixed an error that could occur when deleting a draft.
- Fixed an error that could occur when saving a Structure section entry, if it had an Assets field with a dynamic subpath that referenced `level`. ([#16661](https://github.com/craftcms/cms/pull/16661))
- Fixed a bug where “Fit” image transforms were showing the “Default Focal Point” setting. ([#16665](https://github.com/craftcms/cms/pull/16665))
- Fixed a bug where the “Image Position” setting wasn’t saving for “Letterbox” image transforms. ([#16648](https://github.com/craftcms/cms/issues/16648))
- Fixed a bug where the `up` command, the `app/migrate` action, and the Project Config utility weren’t aware of pending project config changes if a database backup was restored but caches weren’t cleared. ([#16668](https://github.com/craftcms/cms/issues/16668))
- Fixed a bug where condition rules weren’t always getting created with their condition set. ([#16676](https://github.com/craftcms/cms/pull/16676))
- Fixed an error that occurred when opening the filter HUD within the element selection modal for a relational field, if the user didn’t have permission to view the selected source outside of the field. ([#16678](https://github.com/craftcms/cms/issues/16678))
- Fixed a potential phishing attack vector.

## 4.14.4 - 2025-02-04

- Fixed an error that occurred when accessing the `edit/<elementId>` route for a draft that no longer existed.
- Fixed a bug where transformed images could be slightly smaller than they should be when using the `fit` transform mode. ([#16622](https://github.com/craftcms/cms/issues/16622))
- Fixed a bug where tests weren’t outputting exceptions thrown during Craft installation. ([#16624](https://github.com/craftcms/cms/issues/16624))

## 4.14.3 - 2025-01-29

- Added `craft\db\ExpressionBuilder`.
- Added `craft\db\ExpressionInterface`.
- Added compatibility with codeception/module-yii2 1.1.6+. ([#16580](https://github.com/craftcms/cms/pull/16580))
- Fixed a bug where `craft\db\QueryBatcher::getSlice()` wasn’t using the database connection passed to the class constructor. ([#16579](https://github.com/craftcms/cms/issues/16579))
- Fixed a bug where collapsed elements within element indexes in structure view weren’t showing their expand/collapse toggles.

## 4.14.2 - 2025-01-28

- Fixed a bug where Entries fields’ entry select modals could show expand/collapse toggles for Structure sections, for elements that didn’t have any selectable descendants. ([#16506](https://github.com/craftcms/cms/issues/16506))
- Fixed a bug where changes to custom fields within Matrix blocks weren’t getting merged into existing drafts for the same owner element. ([#16519](https://github.com/craftcms/cms/issues/16519))
- Fixed a bug where native fields (e.g. Title) were showing changed statuses when viewing revisions, if they had been updated since the time the revision was created.
- Fixed a bug where eager-loading element queries could create an excessive amount of cache invalidation tags.
- Fixed a bug where it was possible to enable elements for new sites with validation errors. ([#16505](https://github.com/craftcms/cms/issues/16505))
- Fixed a bug where setting `transaction: true` in the Codeception configuration wasn’t rolling back database DML changes after a test. ([#16546](https://github.com/craftcms/cms/issues/16546))
- Fixed a bug where ʻokina characters weren’t being removed in auto-generated slugs. ([#16548](https://github.com/craftcms/cms/issues/16548))

## 4.14.1 - 2025-01-22

- Fixed a bug where all multi-byte characters were getting stripped out of search indexes. ([#16457](https://github.com/craftcms/cms/issues/16457))

## 4.14.0.2 - 2025-01-21

- Fixed an error that occurred when creating a new Structure section. ([#16476](https://github.com/craftcms/cms/issues/16476))
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"twig/twig": "~3.15.0",
"voku/stringy": "^6.4.0",
"webonyx/graphql-php": "~14.11.5",
"yiisoft/yii2": "~2.0.51.0",
"yiisoft/yii2": "~2.0.52.0",
"yiisoft/yii2-debug": "~2.1.25.0",
"yiisoft/yii2-queue": "~2.3.2",
"yiisoft/yii2-symfonymailer": "^2.0.0"
Expand All @@ -78,8 +78,8 @@
"provide": {
"bower-asset/inputmask": "5.0.9",
"bower-asset/jquery": "3.6.1",
"bower-asset/punycode": "2.3.1",
"bower-asset/yii2-pjax": "2.0.8",
"bower-asset/punycode": "^1.4",
"bower-asset/yii2-pjax": "~2.0.1",
"yii2tech/ar-softdelete": "1.0.4"
},
"conflict": {
Expand Down
31 changes: 15 additions & 16 deletions composer.lock

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

4 changes: 2 additions & 2 deletions lib/craft/behaviors/CustomFieldBehavior.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @link http://craftcms.com/
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license http://craftcms.com/license
* @license https://craftcms.github.io/license/
*/

namespace craft\behaviors;
Expand Down
72 changes: 65 additions & 7 deletions src/base/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use craft\behaviors\DraftBehavior;
use craft\behaviors\RevisionBehavior;
use craft\db\Connection;
use craft\db\ExcludeDescendantIdsExpression;
use craft\db\Query;
use craft\db\Table;
use craft\elements\actions\Delete;
Expand Down Expand Up @@ -73,6 +74,7 @@
use craft\validators\SlugValidator;
use craft\validators\StringValidator;
use craft\web\UploadedFile;
use DateTime;
use Illuminate\Support\Collection;
use Throwable;
use Traversable;
Expand Down Expand Up @@ -1123,6 +1125,7 @@ public static function indexHtml(ElementQueryInterface $elementQuery, ?array $di
'collapsedElementIds' => Craft::$app->getRequest()->getParam('collapsedElementIds'),
'showCheckboxes' => $showCheckboxes,
'tableName' => static::pluralDisplayName(),
'elementQuery' => self::elementQueryWithAllDescendants($elementQuery),
];

$db = Craft::$app->getDb();
Expand Down Expand Up @@ -1196,6 +1199,24 @@ public static function indexHtml(ElementQueryInterface $elementQuery, ?array $di
return Craft::$app->getView()->renderTemplate($template, $variables);
}

private static function elementQueryWithAllDescendants(ElementQueryInterface $elementQuery): ElementQueryInterface
{
if (is_array($elementQuery->where)) {
foreach ($elementQuery->where as $key => $condition) {
if ($condition instanceof ExcludeDescendantIdsExpression) {
$elementQuery = clone $elementQuery;
unset($elementQuery->where[$key]);
break;
}
}
} elseif ($elementQuery->where instanceof ExcludeDescendantIdsExpression) {
$elementQuery = clone $elementQuery;
$elementQuery->where = null;
}

return $elementQuery;
}

/**
* Prepares an element query for an element index that includes a given table attribute.
*
Expand Down Expand Up @@ -2518,7 +2539,7 @@ public function afterValidate(): void

if ($field::hasContentColumn()) {
$columnType = $field->getContentColumnType();
$value = $field->serializeValue($this->getFieldValue($field->handle), $this);
$value = $field->serializeValueForDb($this->getFieldValue($field->handle), $this);

if (is_array($columnType)) {
foreach ($columnType as $key => $type) {
Expand Down Expand Up @@ -3751,11 +3772,21 @@ public function getAncestors(?int $dist = null): ElementQueryInterface|Collectio
return $ancestors->filter(fn(self $element) => $element->level >= $this->level - $dist);
}

return $this->ancestors()->ancestorDist($dist);
}

/**
* Returns an element query for fetching the element’s ancestors.
*
* @return ElementQueryInterface
* @since 4.14.7
*/
protected function ancestors(): ElementQueryInterface
{
return static::find()
->structureId($this->structureId)
->ancestorOf($this)
->siteId($this->siteId)
->ancestorDist($dist);
->siteId($this->siteId);
}

/**
Expand All @@ -3771,11 +3802,21 @@ public function getDescendants(?int $dist = null): ElementQueryInterface|Collect
return $descendants->filter(fn(self $element) => $element->level <= $this->level + $dist);
}

return $this->descendants()->descendantDist($dist);
}

/**
* Returns an element query for fetching the element’s descendants.
*
* @return ElementQueryInterface
* @since 4.14.7
*/
protected function descendants(): ElementQueryInterface
{
return static::find()
->structureId($this->structureId)
->descendantOf($this)
->siteId($this->siteId)
->descendantDist($dist);
->siteId($this->siteId);
}

/**
Expand Down Expand Up @@ -4009,7 +4050,7 @@ public function isAttributeModified(string $name): bool
*/
private function _outdatedAttributes(): array
{
if (!static::trackChanges() || $this->getIsCanonical()) {
if (!static::trackChanges() || $this->getIsCanonical() || $this->getIsRevision()) {
return [];
}

Expand Down Expand Up @@ -4169,6 +4210,23 @@ public function getSerializedFieldValues(?array $fieldHandles = null): array
return $serializedValues;
}

/**
* @inheritdoc
*/
public function getSerializedFieldValuesForDb(?array $fieldHandles = null): array
{
$serializedValues = [];

foreach ($this->fieldLayoutFields() as $field) {
if ($fieldHandles === null || in_array($field->handle, $fieldHandles, true)) {
$value = $this->getFieldValue($field->handle);
$serializedValues[$field->handle] = $field->serializeValueForDb($value, $this);
}
}

return $serializedValues;
}

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -4283,7 +4341,7 @@ public function isFieldModified(string $fieldHandle, bool $anySite = false): boo
*/
private function _outdatedFields(): array
{
if (!static::trackChanges() || !$this->getIsDraft() || $this->getIsCanonical()) {
if (!static::trackChanges() || $this->getIsCanonical() || $this->getIsRevision()) {
return [];
}

Expand Down
12 changes: 12 additions & 0 deletions src/base/ElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,18 @@ public function getFieldValues(?array $fieldHandles = null): array;
*/
public function getSerializedFieldValues(?array $fieldHandles = null): array;

/**
* Returns an array of the element’s serialized custom field values, indexed by their handles,
* for database storage.
*
* @param string[]|null $fieldHandles The list of field handles whose values
* need to be returned. Defaults to null, meaning all fields’ values will be
* returned. If it is an array, only the fields in the array will be returned.
* @return array
* @since 4.15.0
*/
public function getSerializedFieldValuesForDb(?array $fieldHandles = null): array;

/**
* Sets the element’s custom field values.
*
Expand Down
Loading