Skip to content

Commit

Permalink
Merge branch 'release/4.7.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 15, 2024
2 parents dd06432 + 07400f1 commit 7b6762d
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG-REPORT-V3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bug ReportCraft 3
name: 'Bug Report: Craft 3'
description: Report an issue or unexpected behavior pertaining to Craft 3
title: '[3.x]: '
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG-REPORT-V4.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bug ReportCraft 4
name: 'Bug Report: Craft 4'
description: Report an issue or unexpected behavior pertaining to Craft 4
title: '[4.x]: '
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG-REPORT-V5.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bug ReportCraft 5
name: 'Bug Report: Craft 5'
description: Report an issue or unexpected behavior pertaining to Craft 5
title: '[5.x]: '
labels:
Expand Down
33 changes: 27 additions & 6 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/craftcms/cms/discussions/new?category=ideas
about: Start a new discussion about your idea
- name: Documentation
url: https://docs.craftcms.com/
url: https://craftcms.com/docs
about: Read the official documentation
- name: Knowledge Base
url: https://craftcms.com/knowledge-base
about: Find answers to common problems
about: Find official answers to common problems
- name: Developer Support Services
url: https://craftcms.com/support-services
about: Priority developer support from the team that makes Craft
- name: Craft Discord
url: https://craftcms.com/discord
about: Meet the community
- name: Stack Exchange
- name: Craft Stack Exchange
url: https://craftcms.stackexchange.com/
about: Get help and help others
- name: 'Feature Request: Craft CMS'
url: https://github.com/craftcms/cms/discussions/new?category=ideas
about: Make a feature request or enhancement for Craft CMS
- name: 'Feature Request: Craft Console / Plugin Store'
url: https://github.com/craftcms/console/discussions/new?category=ideas
about: Make a feature request or enhancement for Craft Console or the Plugin Store
- name: 'Feature Request: Craft Cloud'
url: https://github.com/craftcms/cloud/discussions/new?category=ideas
about: Make a feature request or enhancement for Craft Cloud
- name: 'Feature Request: Craft Commerce'
url: https://github.com/craftcms/commerce/discussions/new?category=ideas
about: Make a feature request or enhancement for Craft Commerce
- name: 'Bug Report: Craft CMS'
url: https://github.com/craftcms/cms/issues/new/choose
about: Create a bug report for Craft CMS
- name: 'Bug Report: Craft Console / Plugin Store'
url: https://github.com/craftcms/console/issues/new/choose
about: Create a bug report for Craft Console or the Plugin Store
- name: 'Bug Report: Craft Cloud'
url: https://craftcms.com/contact
about: Create a bug report for Craft Cloud
- name: 'Bug Report: Craft Commerce'
url: https://github.com/craftcms/commerce/issues/new/choose
about: Create a bug report for Craft Commerce
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.7.3 - 2024-02-15

- Updated the bundled `composer.phar` to Composer 2.7.1. ([CVE-2024-24821](https://github.com/advisories/GHSA-7c6p-848j-wh5h))
- Fixed a bug where read/write splitting was always getting disabled for GraphQL POST requests. ([#14324](https://github.com/craftcms/cms/issues/14324))
- Fixed a bug where GraphQL schema edit pages could include empty category headings.
- Fixed a bug where asset slideouts weren’t showing validation errors on the Filename field. ([#14329](https://github.com/craftcms/cms/issues/14329))
- Fixed a bug where element slideouts would open when long-pressing on an element’s “Remove” button within an element select input.
- Fixed a bug where relations weren’t getting deleted when an element was deleted for a site. ([#14347](https://github.com/craftcms/cms/issues/14347))
- Fixed a SQL error that occurred when saving a Number field with Decimals set to more than 30 on MySQL. ([#14370](https://github.com/craftcms/cms/issues/14370))

## 4.7.2.1 - 2024-02-08

- Craft now requires Composer ^2.7.0. ([CVE-2024-24821](https://github.com/advisories/GHSA-7c6p-848j-wh5h))
Expand Down
Binary file modified lib/composer.phar
Binary file not shown.
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.7.2.1',
'version' => '4.7.3',
'schemaVersion' => '4.5.3.0',
'minVersionRequired' => '3.7.11',
'basePath' => dirname(__DIR__), // Defines the @app alias
Expand Down
4 changes: 3 additions & 1 deletion src/elements/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ public function getPreviewHtml(): string
Html::tag('div', $this->getPreviewThumbImg(350, 190), [
'class' => 'preview-thumb',
]) .
Html::endTag('div'); // .preview-thumb-container;
Html::endTag('div'); // .preview-thumb-container

if ($previewable || $editable) {
$isMobile = Craft::$app->getRequest()->isMobileBrowser(true);
Expand All @@ -2557,6 +2557,7 @@ public function getPreviewHtml(): string
$imageButtonHtml .= Html::button(Craft::t('app', 'Preview'), [
'id' => 'preview-btn',
'class' => ['btn', 'preview-btn'],
'aria-label' => Craft::t('app', 'Preview'),
]);

$previewBtnId = $view->namespaceInputId('preview-btn');
Expand Down Expand Up @@ -2666,6 +2667,7 @@ protected function metaFieldsHtml(bool $static): string
return implode("\n", [
Cp::textFieldHtml([
'label' => Craft::t('app', 'Filename'),
'attribute' => 'newLocation',
'id' => 'new-filename',
'name' => 'newFilename',
'value' => $this->_filename,
Expand Down
16 changes: 16 additions & 0 deletions src/fields/BaseRelationField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,22 @@ public function afterElementSave(ElementInterface $element, bool $isNew): void
parent::afterElementSave($element, $isNew);
}

/**
* @inheritdoc
*/
public function afterElementDeleteForSite(ElementInterface $element): void
{
if ($this->localizeRelations) {
Db::delete(DbTable::RELATIONS, [
'fieldId' => $this->id,
'sourceSiteId' => $element->siteId,
'sourceId' => $element->id,
]);
}

parent::afterElementDeleteForSite($element);
}

/**
* Normalizes the available sources into select input options.
*
Expand Down
5 changes: 5 additions & 0 deletions src/fields/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ protected function defineRules(): array
$rules = parent::defineRules();
$rules[] = [['defaultValue', 'min', 'max'], 'number'];
$rules[] = [['decimals', 'size'], 'integer'];

if ($this->decimals && Craft::$app->getDb()->getIsMysql()) {
$rules[] = [['decimals'], 'integer', 'max' => 30];
}

$rules[] = [
['max'],
'compare',
Expand Down
4 changes: 2 additions & 2 deletions src/templates/graphql/schemas/_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

{% set schemaComponents = craft.app.gql.getAllSchemaComponents %}

{% for category, catPermissions in schemaComponents.queries %}
{% for category, catPermissions in schemaComponents.queries|filter %}
<div class="user-permissions">
<h3>{{ category }}</h3>
<div class="select-all"></div>
Expand All @@ -97,7 +97,7 @@
<hr/>
<h2>{{ 'Choose the available mutations for this schema:'|t('app') }}</h2>

{% for category, catPermissions in schemaComponents.mutations %}
{% for category, catPermissions in schemaComponents.mutations|filter %}
<div class="user-permissions">
<h3>{{ category }}</h3>
<div class="select-all"></div>
Expand Down
6 changes: 4 additions & 2 deletions src/web/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function handleRequest($request, bool $skipSpecialHandling = false): Resp
// Process resource requests before anything else
$this->_processResourceRequest($request);

// Disable read/write splitting for POST requests
// Disable read/write splitting for most POST requests
if (
$request->getIsPost() &&
!in_array($request->getActionSegments(), [
Expand All @@ -171,7 +171,9 @@ public function handleRequest($request, bool $skipSpecialHandling = false): Resp
['element-indexes', 'get-elements'],
['element-indexes', 'get-more-elements'],
['element-indexes', 'get-source-tree-html'],
])
['graphql', 'api'],
]) &&
!$request->getIsGraphql()
) {
$this->getDb()->enableReplicas = false;
}
Expand Down
1 change: 0 additions & 1 deletion src/web/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
/**
* @inheritdoc
* @property string $fullPath The full requested path, including the control panel trigger and pagination info.
* @property string $path The requested path, sans control panel trigger and pagination info.
* @property array $segments The segments of the requested path.
* @property int $pageNum The requested page number.
* @property string $token The token submitted with the request, if there is one.
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/web/assets/cp/src/js/AssetIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ Craft.AssetIndex = Craft.BaseElementIndex.extend(
class: 'btn submit',
'data-icon': 'upload',
style: 'position: relative; overflow: hidden;',
'aria-label': Craft.t('app', 'Upload files'),
text: Craft.t('app', 'Upload files'),
});
this.addButton(this.$uploadButton);
Expand Down
5 changes: 5 additions & 0 deletions src/web/assets/cp/src/js/BaseElementSelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ Craft.BaseElementSelectInput = Garnish.Base.extend(

if (this.settings.editable) {
this._handleShowElementEditor = (ev) => {
// don't open the edit slideout if we are tapholding to drag
if (ev.type === 'taphold' && ev.target.nodeName === 'BUTTON') {
return;
}

var $element = $(ev.currentTarget);
if (
Garnish.hasAttr($element, 'data-editable') &&
Expand Down

0 comments on commit 7b6762d

Please sign in to comment.