Browse Source

Fix Structure entry toggles if they only contain unpublished drafts

pull/11118/head
brandonkelly 3 years ago
parent
commit
30d4748722
No known key found for this signature in database GPG Key ID: 5E86D0CED64C7093
  1. 1
      CHANGELOG.md
  2. 8
      src/templates/_elements/tableview/elements.html

1
CHANGELOG.md

@ -15,6 +15,7 @@
- Fixed an error that occurred when transforming an SVG image without specifying a width or height. ([#11122](https://github.com/craftcms/cms/issues/11122))
- Fixed an error that occurred when saving a Number field with a non-numeric value. ([#11164](https://github.com/craftcms/cms/issues/11164))
- Fixed a bug where it wasn’t possible to drag an item to the top in admin tables. ([#10781](https://github.com/craftcms/cms/issues/10781))
- Fixed a bug where entries within Structure sections weren’t expandable if their only descendants were unpublished drafts.
## 3.7.41 - 2022-05-06

8
src/templates/_elements/tableview/elements.html

@ -9,7 +9,13 @@
{% endif -%}
{% for element in elements %}
{% set totalDescendants = structure ? element.getDescendants().anyStatus().count() %}
{% set totalDescendants = structure
? element.getDescendants()
.anyStatus()
.drafts(null)
.draftOf(false)
.count()
: 0 %}
<tr data-id="{{ element.id }}"{% if structure %} data-level="{{ element.level }}" data-descendants="{{ totalDescendants ?? 0 }}"{% endif %}{% if element.id in disabledElementIds %} class="disabled"{% endif %}>
{% if showCheckboxes %}
<td class="checkbox-cell"><div class="checkbox" title="{{ 'Select'|t('app') }}" aria-label="{{ 'Select'|t('app') }}"></div></td>

Loading…
Cancel
Save