Skip to content

Commit 62ec642

Browse files
committed
Merge branch '5.x' into 5.9
# Conflicts: # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
2 parents ea68bf6 + 5d52950 commit 62ec642

File tree

10 files changed

+46
-13
lines changed

10 files changed

+46
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- Fixed a bug where the Live Preview drag bar wasn’t easily draggable when a nested slideout was open. ([#17781](https://github.com/craftcms/cms/issues/17781))
66
- Fixed a bug where nested slideouts within Live Preview weren’t getting resized when the window was resized.
7+
- Fixed a bug where element index table column sort buttons weren’t being focused after activation. ([#18021](https://github.com/craftcms/cms/pull/18021))
8+
- Fixed a bug where component select inputs could show a “Choose” button even if disabled. ([#18032](https://github.com/craftcms/cms/issues/18032))
79

810
## 5.8.19 - 2025-10-28
911

packages/craftcms-playwright/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ All commands should be run from the cms repo’s location
3030
## Notes
3131

3232
- it uses the same fixtures mechanism as our Codeception tests (`*Fixture.php` files from `<cms repo directory>/tests/fixtures` are copied over to the ddev env and have their namespace adjusted)
33-
- it uses ddev with MySQL 8 as a default, but can be switched to PostgreSQL by editing `<cms repo directory>/tests-playwright/ddev-config/config.local.yaml` file
33+
- it uses ddev with MySQL 8 as a default, but can be switched to PostgreSQL by editing `<cms repo directory>/tests-playwright/ddev-config/config.local.yaml` file; remember to also check your `<cms repo directory>/tests-playwright/.env` file;
3434
- tests are located here: `<cms repo directory>/tests-playwright/tests`
3535

3636
> [!TIP]

src/services/Users.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ class Users extends Component
170170
public const EVENT_AFTER_ASSIGN_USER_TO_DEFAULT_GROUP = 'afterAssignUserToDefaultGroup';
171171

172172
/**
173-
* @event UserSavePhotoEvent The event that is triggered before a user photo is saved.
173+
* @event UserPhotoEvent The event that is triggered before a user photo is saved.
174174
* @since 4.4.0
175175
*/
176176
public const EVENT_BEFORE_SAVE_USER_PHOTO = 'beforeSaveUserPhoto';
177177

178178
/**
179-
* @event UserSavePhotoEvent The event that is triggered after a user photo is saved.
179+
* @event UserPhotoEvent The event that is triggered after a user photo is saved.
180180
* @since 4.4.0
181181
*/
182182
public const EVENT_AFTER_SAVE_USER_PHOTO = 'afterSaveUserPhoto';

src/templates/_includes/forms/componentSelect.twig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
<div class="flex flex-nowrap">
7070
{% set valueIds = values|map(component => component.getId()) %}
7171

72+
{% set buttonAttributeClasses = ['dashed', 'add-btn'] %}
73+
{% if disabled and limit and valueIds|length >= limit %}
74+
{% set buttonAttributeClasses = buttonAttributeClasses|merge(['hidden']) %}
75+
{% endif %}
76+
7277
{# the disclosureMenu already has support for description (shows below the label),
7378
so the description that goes into the info icon needs to be keyed by something else - 'info' #}
7479
{{ disclosureMenu(options|map(component => {
@@ -93,7 +98,7 @@
9398
}), {
9499
buttonLabel: 'Choose'|t('app'),
95100
buttonAttributes: {
96-
class: ['dashed', 'add-btn'],
101+
class: buttonAttributeClasses,
97102
},
98103
omitIfEmpty: false,
99104
withSearchInput,

src/web/assets/cp/dist/cp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/dist/cp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/src/js/BaseElementIndex.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,8 +1705,6 @@ Craft.BaseElementIndex = Garnish.Base.extend(
17051705
cancelToken: this._createCancelToken(),
17061706
})
17071707
.then((response) => {
1708-
this.setIndexAvailable();
1709-
17101708
if (this.settings.context === 'index') {
17111709
if (Craft.cp.fixedHeader) {
17121710
const headerContainerHeight =
@@ -1721,7 +1719,9 @@ Craft.BaseElementIndex = Garnish.Base.extend(
17211719
this.$main.scrollTop(0);
17221720
}
17231721

1724-
this._updateView(this._viewParams, response.data);
1722+
this._updateView(this._viewParams, response.data).then(() => {
1723+
this.setIndexAvailable();
1724+
});
17251725

17261726
if (this.criteriaHasChanged() && !this.sourceHasChanged()) {
17271727
const itemLabel = this.getItemLabel();
@@ -2951,8 +2951,7 @@ Craft.BaseElementIndex = Garnish.Base.extend(
29512951
},
29522952

29532953
setIndexAvailable: function () {
2954-
this.$elements.removeClass('busy');
2955-
this.$updateSpinner.remove();
2954+
this.hideIndexLoadingStyles();
29562955
this.isIndexBusy = false;
29572956

29582957
// Refocus the previously-focused element
@@ -2971,6 +2970,14 @@ Craft.BaseElementIndex = Garnish.Base.extend(
29712970
}
29722971
},
29732972

2973+
/**
2974+
* Hides the loading styles on the element listing pane.
2975+
*/
2976+
hideIndexLoadingStyles: function () {
2977+
this.$elements.removeClass('busy');
2978+
this.$updateSpinner.remove();
2979+
},
2980+
29742981
createCustomizeSourcesModal: function () {
29752982
// Recreate it each time
29762983
var modal = new Craft.CustomizeSourcesModal(this, {

src/web/assets/cp/src/js/TableElementIndexView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ Craft.TableElementIndexView = Craft.BaseElementIndexView.extend({
645645
this.elementIndex.updateElements();
646646

647647
// No need for two spinners
648-
this.elementIndex.setIndexAvailable();
648+
this.elementIndex.hideIndexLoadingStyles();
649649
},
650650

651651
_updateTableAttributes: function ($element, tableAttributes) {

tests-playwright/.env.example

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ REPO_PATH=../../../.
1111
# the actual namespace of the *Fixture.php files
1212
CODECEPTION_FIXTURES_NAMESPACE='crafttests\fixtures'
1313
# the location of the *Fixture.php files relative to the root of your repo
14-
CODECEPTION_FIXTURES_PATH=tests/fixtures
14+
CODECEPTION_FIXTURES_PATH=tests/fixtures
15+
16+
CRAFT_DB_DRIVER="mysql"
17+
CRAFT_DB_SERVER="db"
18+
CRAFT_DB_PORT="3306"
19+
CRAFT_DB_DATABASE="db"
20+
CRAFT_DB_USER="db"
21+
CRAFT_DB_PASSWORD="db"
22+
CRAFT_DB_SCHEMA="public"
23+
CRAFT_DB_TABLE_PREFIX=""

tests-playwright/tests/elementindex/sorting.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,14 @@ test.describe('Sorting', () => {
130130
await page.reload();
131131
}
132132
});
133+
134+
test('Focus is managed when sorting from column header buttons', async ({
135+
page,
136+
baseURL,
137+
}) => {
138+
const postDateButton = page.getByRole('button', {name: 'Post Date'});
139+
await postDateButton.click();
140+
await expect(postDateButton).toBeFocused();
141+
await page.reload();
142+
});
133143
});

0 commit comments

Comments
 (0)