diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a22add56a..50e2158623a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Release Notes for Craft CMS 4 +## 4.4.13 - 2023-05-24 + +- Fixed a bug where asset sources weren‘t immediately showing a source path on a clear `localStorage` cache. +- Fixed a JavaScript error that could occur when searching within an asset index, when there was no source path. ([#13241](https://github.com/craftcms/cms/issues/13241)) +- Fixed a bug where Date fields with “Show Time Zone” enabled were displaying their values in the system’s time zone within element indexes. ([#13233](https://github.com/craftcms/cms/issues/13233)) +- Fixed a bug where the “Cancel” buttons within Dashboard widgets’ settings didn’t do anything. ([#13239](https://github.com/craftcms/cms/issues/13239)) + ## 4.4.12 - 2023-05-23 - Asset indexes now remember their previously-selected source path. ([#13147](https://github.com/craftcms/cms/issues/13147)) diff --git a/src/config/app.php b/src/config/app.php index 4f58153e77e..8ddf7c7589e 100644 --- a/src/config/app.php +++ b/src/config/app.php @@ -3,7 +3,7 @@ return [ 'id' => 'CraftCMS', 'name' => 'Craft CMS', - 'version' => '4.4.12', + 'version' => '4.4.13', 'schemaVersion' => '4.4.0.4', 'minVersionRequired' => '3.7.11', 'basePath' => dirname(__DIR__), // Defines the @app alias diff --git a/src/fields/Date.php b/src/fields/Date.php index 9d99d805b1a..3d39514baf0 100644 --- a/src/fields/Date.php +++ b/src/fields/Date.php @@ -316,19 +316,34 @@ protected function searchKeywords(mixed $value, ElementInterface $element): stri */ public function getTableAttributeHtml(mixed $value, ElementInterface $element): string { + /** @var DateTime|null $value */ if (!$value) { return ''; } + $formatter = Craft::$app->getFormatter(); + if ($this->showDate && $this->showTime) { - return Craft::$app->getFormatter()->asDatetime($value, Locale::LENGTH_SHORT); + if ($this->showTimeZone) { + $timeZone = $formatter->timeZone; + $formatter->timeZone = $value->getTimezone()->getName(); + $html = sprintf( + '%s %s', + $formatter->asDatetime($value, Locale::LENGTH_SHORT), + $value->format('T') + ); + $formatter->timeZone = $timeZone; + return $html; + } + + return $formatter->asDatetime($value, Locale::LENGTH_SHORT); } if ($this->showDate) { - return Craft::$app->getFormatter()->asDate($value, Locale::LENGTH_SHORT); + return $formatter->asDate($value, Locale::LENGTH_SHORT); } - return Craft::$app->getFormatter()->asTime($value, Locale::LENGTH_SHORT); + return $formatter->asTime($value, Locale::LENGTH_SHORT); } /** diff --git a/src/templates/dashboard/_index.twig b/src/templates/dashboard/_index.twig index 8c98950b224..f8df216f4ae 100644 --- a/src/templates/dashboard/_index.twig +++ b/src/templates/dashboard/_index.twig @@ -58,7 +58,7 @@
{{ forms.submitButton({label: 'Save'|t('app'), spinner: true}) }} - {{ forms.button({label: 'Cancel'|t('app')}) }} + {{ forms.button({label: 'Cancel'|t('app'), class: 'cancel-btn'}) }}
diff --git a/src/web/Application.php b/src/web/Application.php index 507266b78af..fa9745747da 100644 --- a/src/web/Application.php +++ b/src/web/Application.php @@ -25,6 +25,7 @@ use craft\queue\QueueLogBehavior; use IntlDateFormatter; use IntlException; +use ReflectionClass; use Throwable; use yii\base\Component; use yii\base\ErrorException; @@ -35,6 +36,7 @@ use yii\base\InvalidRouteException; use yii\base\Response as BaseResponse; use yii\db\Exception as DbException; +use yii\debug\Module as YiiDebugModule; use yii\debug\panels\AssetPanel; use yii\debug\panels\DbPanel; use yii\debug\panels\LogPanel; @@ -433,9 +435,13 @@ protected function debugBootstrap(): void $svg = rawurlencode(file_get_contents(dirname(__DIR__) . '/icons/c-debug.svg')); DebugModule::setYiiLogo("data:image/svg+xml;charset=utf-8,$svg"); + // Determine the base path using reflection in case it wasn't loaded from @vendor + $ref = new ReflectionClass(YiiDebugModule::class); + $basePath = dirname($ref->getFileName()); + $this->setModule('debug', [ 'class' => DebugModule::class, - 'basePath' => '@vendor/yiisoft/yii2-debug/src', + 'basePath' => $basePath, 'allowedIPs' => ['*'], 'panels' => [ 'config' => false, diff --git a/src/web/assets/cp/dist/cp.js b/src/web/assets/cp/dist/cp.js index 5e5104f9f9a..5241b8f7b95 100644 --- a/src/web/assets/cp/dist/cp.js +++ b/src/web/assets/cp/dist/cp.js @@ -1,2 +1,2 @@ -(function(){var __webpack_modules__={463:function(){Craft.Accordion=Garnish.Base.extend({$trigger:null,targetSelector:null,_$target:null,init:function(t){var e=this;this.$trigger=$(t),this.$trigger.data("accordion")&&(console.warn("Double-instantiating an accordion trigger on an element"),this.$trigger.data("accordion").destroy()),this.$trigger.data("accordion",this),this.targetSelector=this.$trigger.attr("aria-controls")?"#".concat(this.$trigger.attr("aria-controls")):null,this.targetSelector&&(this._$target=$(this.targetSelector)),this.addListener(this.$trigger,"click","onTriggerClick"),this.addListener(this.$trigger,"keypress",(function(t){var i=t.keyCode;i!==Garnish.SPACE_KEY&&i!==Garnish.RETURN_KEY||(t.preventDefault(),e.onTriggerClick())}))},onTriggerClick:function(){"true"===this.$trigger.attr("aria-expanded")?this.hideTarget(this._$target):this.showTarget(this._$target)},showTarget:function(t){var e=this;if(t&&t.length){this.showTarget._currentHeight=t.height(),t.removeClass("hidden"),this.$trigger.removeClass("collapsed").addClass("expanded").attr("aria-expanded","true");for(var i=0;i .address-card");for(var s=0;s=this.settings.maxItems)){var e=$(t).appendTo(this.$tbody),i=e.find(".delete");this.settings.sortable&&this.sorter.addItems(e),this.$deleteBtns=this.$deleteBtns.add(i),this.addListener(i,"click","handleDeleteBtnClick"),this.totalItems++,this.updateUI()}},reorderItems:function(){var t=this;if(this.settings.sortable){for(var e=[],i=0;i=this.settings.maxItems?$(this.settings.newItemBtnSelector).addClass("hidden"):$(this.settings.newItemBtnSelector).removeClass("hidden"))}},{defaults:{tableSelector:null,noItemsSelector:null,newItemBtnSelector:null,idAttribute:"data-id",nameAttribute:"data-name",sortable:!1,allowDeleteAll:!0,minItems:0,maxItems:null,reorderAction:null,deleteAction:null,reorderSuccessMessage:Craft.t("app","New order saved."),reorderFailMessage:Craft.t("app","Couldn’t save new order."),confirmDeleteMessage:Craft.t("app","Are you sure you want to delete “{name}”?"),deleteSuccessMessage:Craft.t("app","“{name}” deleted."),deleteFailMessage:Craft.t("app","Couldn’t delete “{name}”."),onReorderItems:$.noop,onDeleteItem:$.noop}})},6872:function(){Craft.AssetImageEditor=Garnish.Modal.extend({$body:null,$footer:null,$imageTools:null,$buttons:null,$cancelBtn:null,$replaceBtn:null,$saveBtn:null,$focalPointBtn:null,$editorContainer:null,$straighten:null,$croppingCanvas:null,$spinner:null,$constraintContainer:null,$constraintRadioInputs:null,$customConstraints:null,canvas:null,image:null,viewport:null,focalPoint:null,grid:null,croppingCanvas:null,clipper:null,croppingRectangle:null,cropperHandles:null,cropperGrid:null,croppingShade:null,imageStraightenAngle:0,viewportRotation:0,originalWidth:0,originalHeight:0,imageVerticeCoords:null,zoomRatio:1,animationInProgress:!1,currentView:"",assetId:null,cacheBust:null,draggingCropper:!1,scalingCropper:!1,draggingFocal:!1,previousMouseX:0,previousMouseY:0,shiftKeyHeld:!1,editorHeight:0,editorWidth:0,cropperState:!1,scaleFactor:1,flipData:{},focalPointState:!1,maxImageSize:null,lastLoadedDimensions:null,imageIsLoading:!1,mouseMoveEvent:null,croppingConstraint:!1,constraintOrientation:"landscape",showingCustomConstraint:!1,saving:!1,renderImage:null,renderCropper:null,_queue:null,init:function(t,e){var i=this;this._queue=new Craft.Queue,this.cacheBust=Date.now(),this.setSettings(e,Craft.AssetImageEditor.defaults),null===this.settings.allowDegreeFractions&&(this.settings.allowDegreeFractions=Craft.isImagick),Garnish.prefersReducedMotion()&&(this.settings.animationDuration=1),this.assetId=t,this.flipData={x:0,y:0},this.$container=$('').appendTo(Garnish.$bod),this.$body=$('
').appendTo(this.$container),this.$footer=$('