mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge remote-tracking branch 'origin/3.5' into 3.6
This commit is contained in:
commit
96ec6e9181
18
docs/en/04_Changelogs/3.5.7.md
Normal file
18
docs/en/04_Changelogs/3.5.7.md
Normal file
@ -0,0 +1,18 @@
|
||||
# 3.5.7
|
||||
|
||||
<!--- Changes below this line will be automatically regenerated -->
|
||||
|
||||
## Change Log
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* 2018-01-26 [416915b08](https://github.com/silverstripe/silverstripe-framework/commit/416915b08248285083518850ad8d015ca8ed25c2) tableName is blank in CompositeDBField->addToQuery (Dominik Beerbohm)
|
||||
* 2018-01-25 [cf69d0486](https://github.com/silverstripe/silverstripe-framework/commit/cf69d048665befa90eb43146f86cde984b876b3a) Fix ping including requirements (Damian Mooyman)
|
||||
* 2018-01-24 [c2cd6b383](https://github.com/silverstripe/silverstripe-framework/commit/c2cd6b3832c6bc4775b2742df593b445c2aca391) Fix Member_GroupSet::removeAll() (fixes #3948) (Loz Calver)
|
||||
* 2018-01-24 [f2b4c192e](https://github.com/silverstripe/silverstripe-framework/commit/f2b4c192ec4d70779f7c667a976e741a7f3a26c5) Fix UploadField cuts off “Save” button (closes #2862) (Loz Calver)
|
||||
* 2018-01-23 [7384e3fc2](https://github.com/silverstripe/silverstripe-framework/commit/7384e3fc25987742ea08af74b704857a936e8ec0) Gridfields with dropdowns having lots of overflow (Scott Hutchinson)
|
||||
* 2017-12-21 [44930f211](https://github.com/silverstripe/silverstripe-framework/commit/44930f211be3f658fc92f2d5318255de03078701) Allow HTML 5 input tags in FunctionalTest form submissions (Daniel Hensby)
|
||||
* 2017-12-14 [81150c592](https://github.com/silverstripe/silverstripe-framework/commit/81150c59225dbf1e95bb0b4dbcfbe18346f2bdff) Use PHP 5.3 array syntax (Daniel Hensby)
|
||||
* 2016-10-21 [8e5bb6fbd](https://github.com/silverstripe/silverstripe-framework/commit/8e5bb6fbdce0b2ca2d08a45534df2264db5e6b12) Fix : relObject() should return null if one of the node is null (Jason)
|
||||
* 2016-03-15 [22b3a71ec](https://github.com/silverstripe/silverstripe-framework/commit/22b3a71ec0c8cd8c38030fa0bf5449abefafe8a3) ing val reference to url in https hotlink (Denise Rivera)
|
||||
* 2015-04-22 [1f63637b9](https://github.com/silverstripe/silverstripe-framework/commit/1f63637b9369d4644a92523ada5d1a5dc0576c12) for #4095, TinyMCE not able to modify props of embed media (bug 1) and invalid HTML inserted (bug 2) (Patrick Nelson)
|
@ -357,7 +357,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$fromWeb = new CompositeField(
|
||||
new LiteralField('headerURL',
|
||||
'<h4>' . sprintf($numericLabelTmpl, '1', _t('HtmlEditorField.ADDURL', 'Add URL')) . '</h4>'),
|
||||
$remoteURL = new TextField('RemoteURL', 'http://'),
|
||||
$remoteURL = new TextField('RemoteURL', ''),
|
||||
new LiteralField('addURLImage',
|
||||
'<button type="button" class="action ui-action-constructive ui-button field add-url" data-icon="addMedia">' .
|
||||
_t('HtmlEditorField.BUTTONADDURL', 'Add url').'</button>')
|
||||
|
@ -1142,7 +1142,6 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
var val = this.val(), orig = val;
|
||||
|
||||
val = $.trim(val);
|
||||
val = val.replace(/^https?:\/\//i, '');
|
||||
if (orig !== val) this.val(val);
|
||||
|
||||
this.getAddButton().button(!!val ? 'enable' : 'disable');
|
||||
@ -1160,10 +1159,17 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
|
||||
onclick: function(e) {
|
||||
var urlField = this.getURLField(), container = this.closest('.CompositeField'), form = this.closest('form');
|
||||
var val = urlField.val();
|
||||
|
||||
if (urlField.validate()) {
|
||||
container.addClass('loading');
|
||||
form.showFileView('http://' + urlField.val()).done(function() {
|
||||
|
||||
// add "http://" if a protocol is missing from the url
|
||||
if (val.match(/^https?:\/\//i) == void 0) {
|
||||
val = 'http://' + val;
|
||||
}
|
||||
|
||||
form.showFileView(val).done(function() {
|
||||
container.removeClass('loading');
|
||||
});
|
||||
form.redraw();
|
||||
@ -1411,22 +1417,76 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
};
|
||||
},
|
||||
getHTML: function() {
|
||||
var el,
|
||||
attrs = this.getAttributes(),
|
||||
extraData = this.getExtraData(),
|
||||
// imgEl = $('<img id="_ss_tmp_img" />');
|
||||
imgEl = $('<img />').attr(attrs).addClass('ss-htmleditorfield-file embed');
|
||||
/* NOP. Instead, will override insertHTML() below and directly update these elements. */
|
||||
|
||||
},
|
||||
/**
|
||||
* Logic similar to TinyMCE 'advimage' plugin, insertAndClose() method.
|
||||
*/
|
||||
insertHTML: function(ed) {
|
||||
var form = this.closest('form');
|
||||
var node = form.getSelection();
|
||||
|
||||
// Get the attributes & extra data
|
||||
var attrs = this.getAttributes(), extraData = this.getExtraData();
|
||||
|
||||
// Find the element we are replacing - either the img, it's wrapper parent, or nothing (if creating)
|
||||
var replacee = (node && node.is('img')) ? node : null;
|
||||
if (replacee && replacee.parent().is('.captionImage')) replacee = replacee.parent();
|
||||
|
||||
// Find the img node - either the existing img or a new one, and update it
|
||||
var img = (node && node.is('img')) ? node : $('<img />').attr(attrs).addClass('ss-htmleditorfield-file embed');
|
||||
|
||||
// Setup extra data.
|
||||
$.each(extraData, function (key, value) {
|
||||
imgEl.attr('data-' + key, value);
|
||||
img.attr('data-' + key, value);
|
||||
});
|
||||
|
||||
// Any existing figure or caption node
|
||||
var container = img.parent('.captionImage'), caption = container.find('.caption');
|
||||
|
||||
// If we've got caption text, we need a wrapping div.captionImage and sibling p.caption
|
||||
if(extraData.CaptionText) {
|
||||
el = $('<div style="width: ' + attrs['width'] + 'px;" class="captionImage ' + attrs['class'] + '"><p class="caption">' + extraData.CaptionText + '</p></div>').prepend(imgEl);
|
||||
} else {
|
||||
el = imgEl;
|
||||
if (!container.length) {
|
||||
container = $('<div></div>');
|
||||
}
|
||||
return $('<div />').append(el).html(); // Little hack to get outerHTML string
|
||||
|
||||
container.attr('class', 'captionImage '+attrs['class']).css('width', attrs.width);
|
||||
|
||||
if (!caption.length) {
|
||||
caption = $('<p class="caption"></p>').appendTo(container);
|
||||
}
|
||||
|
||||
caption.attr('class', 'caption '+attrs['class']).text(extraData.CaptionText);
|
||||
}
|
||||
// Otherwise forget they exist
|
||||
else {
|
||||
container = caption = null;
|
||||
}
|
||||
|
||||
// The element we are replacing the replacee with
|
||||
var replacer = container ? container : img;
|
||||
|
||||
// If we're replacing something, and it's not with itself, do so
|
||||
if (replacee && replacee.not(replacer).length) {
|
||||
replacee.replaceWith(replacer);
|
||||
}
|
||||
|
||||
// If we have a wrapper element, make sure the img is the first child - img might be the
|
||||
// replacee, and the wrapper the replacer, and we can't do this till after the replace has happened
|
||||
if (container) {
|
||||
container.prepend(img);
|
||||
}
|
||||
|
||||
// If we don't have a replacee, then we need to insert the whole HTML
|
||||
if (!replacee) {
|
||||
// Otherwise insert the whole HTML content
|
||||
ed.repaint();
|
||||
ed.insertContent($('<div />').append(replacer).html(), {skip_undo : 1});
|
||||
}
|
||||
|
||||
ed.addUndo();
|
||||
ed.repaint();
|
||||
},
|
||||
updateFromNode: function(node) {
|
||||
this.find(':input[name=AltText]').val(node.attr('alt'));
|
||||
@ -1435,6 +1495,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
this.find(':input[name=Height]').val(node.height());
|
||||
this.find(':input[name=Title]').val(node.attr('title'));
|
||||
this.find(':input[name=CSSClass]').val(node.data('cssclass'));
|
||||
this.find(':input[name=CaptionText]').val(node.siblings('.caption:first').text());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -450,6 +450,10 @@
|
||||
if (iframe.data('src')) {
|
||||
self._prepareIframe(iframe, editform, itemInfo);
|
||||
iframe.data('src', '');
|
||||
// Subsequent load events are likely form submissions, which may change
|
||||
// the height if alert dialogs are displayed
|
||||
} else {
|
||||
editform.fitHeight();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -3072,8 +3072,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
$relations = explode('.', $fieldName);
|
||||
$fieldName = array_pop($relations);
|
||||
foreach($relations as $relation) {
|
||||
// Bail if the component is null
|
||||
if(!$component) {
|
||||
return null;
|
||||
// Inspect $component for element $relation
|
||||
if($component->hasMethod($relation)) {
|
||||
} elseif($component->hasMethod($relation)) {
|
||||
// Check nested method
|
||||
$component = $component->$relation();
|
||||
} elseif($component instanceof SS_List) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user