From 3bc2798e726221cfcadfa1bff13222073aa76abb Mon Sep 17 00:00:00 2001 From: jakr Date: Tue, 24 Jul 2012 12:54:23 +0200 Subject: [PATCH 1/7] Fix edge case in sessionStorage detection for FireFox. If it is disabled using about:config, typeof will be object, but the value will be null. --- admin/javascript/LeftAndMain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index c558474af..1325baca3 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -441,7 +441,7 @@ jQuery.noConflict(); * Requires HTML5 sessionStorage support. */ saveTabState: function() { - if(typeof(window.sessionStorage)=="undefined") return; + if(typeof(window.sessionStorage)=="undefined" || window.sessionStorage == null) return; var selectedTabs = [], url = this._tabStateUrl(); this.find('.cms-tabset,.ss-tabset').each(function(i, el) { @@ -459,7 +459,7 @@ jQuery.noConflict(); * Requires HTML5 sessionStorage support. */ restoreTabState: function() { - if(typeof(window.sessionStorage)=="undefined") return; + if(typeof(window.sessionStorage)=="undefined" || window.sessionStorage == null) return; var self = this, url = this._tabStateUrl(), data = window.sessionStorage.getItem('tabs-' + url), From ae52be54f01ae51c0ff4143a6a2b1535f58f6770 Mon Sep 17 00:00:00 2001 From: Naomi Guyer Date: Tue, 7 Aug 2012 16:40:19 +1200 Subject: [PATCH 2/7] FIX: Missing last login time (fixes 7666) Add in missing user login time --- forms/DatetimeField.php | 5 +++-- security/Member.php | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/forms/DatetimeField.php b/forms/DatetimeField.php index 59a0be4be..26b8edd0a 100644 --- a/forms/DatetimeField.php +++ b/forms/DatetimeField.php @@ -290,6 +290,7 @@ class DatetimeField_Readonly extends DatetimeField { function Field($properties = array()) { $valDate = $this->dateField->dataValue(); $valTime = $this->timeField->dataValue(); + if($valDate && $valTime) { $format = sprintf( $this->getConfig('datetimeorder'), @@ -302,9 +303,9 @@ class DatetimeField_Readonly extends DatetimeField { $this->dateField->getLocale() ); $val = $valueObj->toString($format); + } else { - // TODO Localization - $val = '(not set)'; + $val = sprintf('%s', _t('DatetimeField.NOTSET', 'Not set')); } return "id() . "\">$val"; diff --git a/security/Member.php b/security/Member.php index a534391c6..4b6e624e7 100644 --- a/security/Member.php +++ b/security/Member.php @@ -1143,8 +1143,9 @@ class Member extends DataObject implements TemplateGlobalProvider { $mainFields->removeByName('Salt'); $mainFields->removeByName('NumVisit'); - $mainFields->removeByName('LastVisited'); - + + $mainFields->makeFieldReadonly('LastVisited'); + $fields->removeByName('Subscriptions'); // Groups relation will get us into logical conflicts because @@ -1214,7 +1215,7 @@ class Member extends DataObject implements TemplateGlobalProvider { ) ); $timeFormatField->setValue($this->TimeFormat); - + $this->extend('updateCMSFields', $fields); return $fields; From 5c5a50687851015c01c76f7795e8b4e0f12aa7e6 Mon Sep 17 00:00:00 2001 From: Nik Rolls Date: Fri, 10 Aug 2012 18:32:55 +1200 Subject: [PATCH 3/7] BUG removed use of deprecated method --- filesystem/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filesystem/File.php b/filesystem/File.php index d8846fe7f..730401c48 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -920,8 +920,9 @@ class File extends DataObject { */ static function set_class_for_file_extension($exts, $class) { if(!is_array($exts)) $exts = array($exts); + foreach($exts as $ext) { - if(ClassInfo::is_subclass_of($ext, 'File')) { + if(is_subclass_of($ext, 'File')) { throw new InvalidArgumentException( sprintf('Class "%s" (for extension "%s") is not a valid subclass of File', $class, $ext) ); From b649c09b08c3c19b91177b99ad61ae1d7047700c Mon Sep 17 00:00:00 2001 From: Jak Date: Fri, 10 Aug 2012 18:53:33 +1200 Subject: [PATCH 4/7] BUG prevent notice when using selection group --- forms/SelectionGroup.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/forms/SelectionGroup.php b/forms/SelectionGroup.php index 3d3e60712..205994e25 100644 --- a/forms/SelectionGroup.php +++ b/forms/SelectionGroup.php @@ -37,6 +37,8 @@ class SelectionGroup extends CompositeField { $count = 0; $firstSelected = $checked =""; + $newItems = array(); + foreach($items as $key => $item) { if(strpos($key,'//') !== false) { list($key,$title) = explode('//', $key,2); From ce2d31b060c2e7d976eb9e192b4a186828ec103b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 10 Aug 2012 10:27:33 +0200 Subject: [PATCH 5/7] BUG Consistently self-closing form field tags (#7557) This is reverting templates back to pre-3.0 conventions, which were dominated by XHTML templates. HTML5 allows both self-closing and unclosed tags, so opting for self-closing to achieve maximum compatibility. --- templates/forms/CheckboxField.ss | 2 +- templates/forms/CheckboxSetField.ss | 2 +- templates/forms/FileField.ss | 4 ++-- templates/forms/FormAction.ss | 2 +- templates/forms/FormField.ss | 2 +- templates/forms/OptionsetField.ss | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/forms/CheckboxField.ss b/templates/forms/CheckboxField.ss index 9a99273fa..3d989c431 100644 --- a/templates/forms/CheckboxField.ss +++ b/templates/forms/CheckboxField.ss @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/templates/forms/CheckboxSetField.ss b/templates/forms/CheckboxSetField.ss index 6de74f359..b8962957a 100644 --- a/templates/forms/CheckboxSetField.ss +++ b/templates/forms/CheckboxSetField.ss @@ -2,7 +2,7 @@ <% if Options.Count %> <% loop Options %>
  • - checked="checked"<% end_if %><% if isDisabled %> disabled="disabled"<% end_if %>> + checked="checked"<% end_if %><% if isDisabled %> disabled="disabled"<% end_if %> />
  • <% end_loop %> diff --git a/templates/forms/FileField.ss b/templates/forms/FileField.ss index 1117adb91..13f4278e5 100644 --- a/templates/forms/FileField.ss +++ b/templates/forms/FileField.ss @@ -1,2 +1,2 @@ - - + + diff --git a/templates/forms/FormAction.ss b/templates/forms/FormAction.ss index eaa2fe53e..fb5cf21ee 100644 --- a/templates/forms/FormAction.ss +++ b/templates/forms/FormAction.ss @@ -3,5 +3,5 @@ <% if ButtonContent %>$ButtonContent<% else %>$Title<% end_if %> <% else %> - + <% end_if %> \ No newline at end of file diff --git a/templates/forms/FormField.ss b/templates/forms/FormField.ss index 2a6df417b..a29e2a33e 100644 --- a/templates/forms/FormField.ss +++ b/templates/forms/FormField.ss @@ -5,5 +5,5 @@ $Value <% else %> - + <% end_if %> diff --git a/templates/forms/OptionsetField.ss b/templates/forms/OptionsetField.ss index aff9ec636..d1a29d0cb 100644 --- a/templates/forms/OptionsetField.ss +++ b/templates/forms/OptionsetField.ss @@ -1,7 +1,7 @@
      title="$Description"<% end_if %>> <% loop Options %>
    • - checked<% end_if %><% if isDisabled %> disabled<% end_if %>> + checked<% end_if %><% if isDisabled %> disabled<% end_if %> />
    • <% end_loop %> From 8d9db7f61aa7d629efd46b9950206ec6e05c1e0b Mon Sep 17 00:00:00 2001 From: dd1079 Date: Tue, 7 Aug 2012 18:05:45 +0200 Subject: [PATCH 6/7] FIX: Proper buttonset styling --- admin/css/screen.css | 3 ++- admin/scss/_forms.scss | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/admin/css/screen.css b/admin/css/screen.css index f6e158aa4..804165a0e 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -193,7 +193,6 @@ form.small .field input.text, form.small .field textarea, form.small .field sele .cms input.loading .ui-icon, .cms button.loading .ui-icon, .cms input.ui-state-default.loading .ui-icon, .cms .ui-widget-content input.ui-state-default.loading .ui-icon, .cms .ui-widget-header input.ui-state-default.loading .ui-icon { background: transparent url(../../images/network-save.gif) no-repeat 0 0; } .cms input.loading.ss-ui-action-constructive .ui-icon, .cms button.loading.ss-ui-action-constructive .ui-icon { background: transparent url(../../images/network-save-constructive.gif) no-repeat 0 0; } .cms .ss-ui-button { margin-top: 0px; font-weight: bold; text-decoration: none; line-height: 16px; color: #393939; border: 1px solid #c0c0c2; border-bottom: 1px solid #a6a6a9; cursor: pointer; background-color: #e6e6e6; white-space: nowrap; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d9d9d9)); background: -webkit-linear-gradient(#ffffff, #d9d9d9); background: -moz-linear-gradient(#ffffff, #d9d9d9); background: -o-linear-gradient(#ffffff, #d9d9d9); background: linear-gradient(#ffffff, #d9d9d9); text-shadow: white 0 1px 1px; /* constructive */ /* destructive */ } -.cms .ss-ui-button.buttonset { margin: 0 -1px; } .cms .ss-ui-button.ui-state-hover, .cms .ss-ui-button:hover { text-decoration: none; background-color: white; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U2ZTZlNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #e6e6e6)); background: -webkit-linear-gradient(#ffffff, #e6e6e6); background: -moz-linear-gradient(#ffffff, #e6e6e6); background: -o-linear-gradient(#ffffff, #e6e6e6); background: linear-gradient(#ffffff, #e6e6e6); -webkit-box-shadow: 0 0 5px #b3b3b3; -moz-box-shadow: 0 0 5px #b3b3b3; box-shadow: 0 0 5px #b3b3b3; } .cms .ss-ui-button:active, .cms .ss-ui-button:focus, .cms .ss-ui-button.ui-state-active, .cms .ss-ui-button.ui-state-focus { border: 1px solid #b3b3b3; background-color: white; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U2ZTZlNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #e6e6e6)); background: -webkit-linear-gradient(#ffffff, #e6e6e6); background: -moz-linear-gradient(#ffffff, #e6e6e6); background: -o-linear-gradient(#ffffff, #e6e6e6); background: linear-gradient(#ffffff, #e6e6e6); -webkit-box-shadow: 0 0 5px #b3b3b3 inset; -moz-box-shadow: 0 0 5px #b3b3b3 inset; box-shadow: 0 0 5px #b3b3b3 inset; } .cms .ss-ui-button.ss-ui-action-constructive { text-shadow: none; font-weight: bold; color: white; border-color: #1f9433; border-bottom-color: #166a24; background-color: #1f9433; background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzkzYmU0MiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzFmOTQzMyIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #93be42), color-stop(100%, #1f9433)); background: -webkit-linear-gradient(#93be42, #1f9433); background: -moz-linear-gradient(#93be42, #1f9433); background: -o-linear-gradient(#93be42, #1f9433); background: linear-gradient(#93be42, #1f9433); text-shadow: #1c872f 0 -1px -1px; } @@ -206,6 +205,8 @@ form.small .field input.text, form.small .field textarea, form.small .field sele .cms .ss-ui-button.ss-ui-action-minor:hover { text-decoration: none; color: #1f1f1f; } .cms .ss-ui-button.ss-ui-action-minor:focus, .cms .ss-ui-button.ss-ui-action-minor:active { text-decoration: none; color: #525252; } .cms .ss-ui-button.ss-ui-button-loading { opacity: 0.8; } +.cms .ss-ui-buttonset .ui-button { margin-left: -1px; } +.cms .ss-ui-buttonset { margin-left: 1px; } .cms .ss-ui-loading-icon { background: url(../../images/network-save.gif) no-repeat; display: block; width: 16px; height: 16px; } /** ---------------------------------------------------- Grouped form fields ---------------------------------------------------- */ diff --git a/admin/scss/_forms.scss b/admin/scss/_forms.scss index 6df09ef6b..302d7b381 100644 --- a/admin/scss/_forms.scss +++ b/admin/scss/_forms.scss @@ -320,10 +320,6 @@ form.small .field, .field.small { @include text-shadow(lighten($color-button-generic, 20%) 0 1px 1px); - &.buttonset { - margin: 0 -1px; // hack to avoid double borders - } - &.ui-state-hover, &:hover { text-decoration: none; background-color: lighten($color-button-generic, 10%); @@ -421,6 +417,16 @@ form.small .field, .field.small { opacity: 0.8; } } + + .ss-ui-buttonset { + .ui-button { + margin-left: -1px; + } + } + + .ss-ui-buttonset { + margin-left: 1px; + } .ss-ui-loading-icon { background: url(../../images/network-save.gif) no-repeat; From 395580bdd6b9469433501102d0b91c05089e78d4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 12 Aug 2012 22:11:55 +0200 Subject: [PATCH 7/7] BUG Locale-isolated i18n/Zend cache In certain cases (e.g. with the mi_NZ locale), the i18n system would regard a langage as already loaded if it was restored from a cached, but empty translation list (through Zend_Translate). This was due to the cache key being generated based solely on the content, rather than taking other options like the locale into account. --- i18n/i18n.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/i18n.php b/i18n/i18n.php index 7a518d3bb..12424b369 100644 --- a/i18n/i18n.php +++ b/i18n/i18n.php @@ -1995,7 +1995,7 @@ class i18n extends Object implements TemplateGlobalProvider { // and the next invocation of include_by_locale() doesn't cause a new reparse. $adapter->addTranslation( array( - 'content' => array('_' => '_'), + 'content' => array($locale => $locale), // Cached by content hash, so needs to be locale dependent 'locale' => $locale, 'usetranslateadapter' => true )