updated core from 8.4 to 8.5 : bug with login_destination

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-13 14:01:21 +01:00
parent 0d78da249b
commit e668535a4e
3486 changed files with 89604 additions and 33283 deletions
+15 -17
View File
@@ -16,11 +16,9 @@
Drupal.behaviors.ViewsAjaxView.attach = function () {
if (drupalSettings && drupalSettings.views && drupalSettings.views.ajaxViews) {
const ajaxViews = drupalSettings.views.ajaxViews;
for (const i in ajaxViews) {
if (ajaxViews.hasOwnProperty(i)) {
Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]);
}
}
Object.keys(ajaxViews || {}).forEach((i) => {
Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]);
});
}
};
@@ -49,12 +47,12 @@
this.$view = $(selector);
// Retrieve the path to use for views' ajax.
let ajax_path = drupalSettings.views.ajax_path;
let ajaxPath = drupalSettings.views.ajax_path;
// If there are multiple views this might've ended up showing up multiple
// times.
if (ajax_path.constructor.toString().indexOf('Array') !== -1) {
ajax_path = ajax_path[0];
if (ajaxPath.constructor.toString().indexOf('Array') !== -1) {
ajaxPath = ajaxPath[0];
}
// Check if there are any GET parameters to send to views.
@@ -63,14 +61,14 @@
// Remove the question mark and Drupal path component if any.
queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, '');
if (queryString !== '') {
// If there is a '?' in ajax_path, clean url are on and & should be
// If there is a '?' in ajaxPath, clean url are on and & should be
// used to add parameters.
queryString = ((/\?/.test(ajax_path)) ? '&' : '?') + queryString;
queryString = ((/\?/.test(ajaxPath)) ? '&' : '?') + queryString;
}
}
this.element_settings = {
url: ajax_path + queryString,
url: ajaxPath + queryString,
submit: settings,
setClick: true,
event: 'click',
@@ -97,12 +95,12 @@
// @code
// $('.view-name').trigger('RefreshView');
// @endcode
const self_settings = $.extend({}, this.element_settings, {
const selfSettings = $.extend({}, this.element_settings, {
event: 'RefreshView',
base: this.selector,
element: this.$view.get(0),
});
this.refreshViewAjax = Drupal.ajax(self_settings);
this.refreshViewAjax = Drupal.ajax(selfSettings);
};
/**
@@ -114,11 +112,11 @@
// Exclude the reset buttons so no AJAX behaviours are bound. Many things
// break during the form reset phase if using AJAX.
$('input[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) {
const self_settings = $.extend({}, that.element_settings, {
const selfSettings = $.extend({}, that.element_settings, {
base: $(this).attr('id'),
element: this,
});
that.exposedFormAjax[index] = Drupal.ajax(self_settings);
that.exposedFormAjax[index] = Drupal.ajax(selfSettings);
});
};
@@ -162,12 +160,12 @@
Drupal.Views.parseViewArgs(href, this.settings.view_base_path),
);
const self_settings = $.extend({}, this.element_settings, {
const selfSettings = $.extend({}, this.element_settings, {
submit: viewData,
base: false,
element: link,
});
this.pagerAjax = Drupal.ajax(self_settings);
this.pagerAjax = Drupal.ajax(selfSettings);
};
/**
+14 -16
View File
@@ -10,11 +10,9 @@
Drupal.behaviors.ViewsAjaxView.attach = function () {
if (drupalSettings && drupalSettings.views && drupalSettings.views.ajaxViews) {
var ajaxViews = drupalSettings.views.ajaxViews;
for (var i in ajaxViews) {
if (ajaxViews.hasOwnProperty(i)) {
Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]);
}
}
Object.keys(ajaxViews || {}).forEach(function (i) {
Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]);
});
}
};
@@ -26,22 +24,22 @@
var selector = '.js-view-dom-id-' + settings.view_dom_id;
this.$view = $(selector);
var ajax_path = drupalSettings.views.ajax_path;
var ajaxPath = drupalSettings.views.ajax_path;
if (ajax_path.constructor.toString().indexOf('Array') !== -1) {
ajax_path = ajax_path[0];
if (ajaxPath.constructor.toString().indexOf('Array') !== -1) {
ajaxPath = ajaxPath[0];
}
var queryString = window.location.search || '';
if (queryString !== '') {
queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, '');
if (queryString !== '') {
queryString = (/\?/.test(ajax_path) ? '&' : '?') + queryString;
queryString = (/\?/.test(ajaxPath) ? '&' : '?') + queryString;
}
}
this.element_settings = {
url: ajax_path + queryString,
url: ajaxPath + queryString,
submit: settings,
setClick: true,
event: 'click',
@@ -56,12 +54,12 @@
this.$view.filter($.proxy(this.filterNestedViews, this)).once('ajax-pager').each($.proxy(this.attachPagerAjax, this));
var self_settings = $.extend({}, this.element_settings, {
var selfSettings = $.extend({}, this.element_settings, {
event: 'RefreshView',
base: this.selector,
element: this.$view.get(0)
});
this.refreshViewAjax = Drupal.ajax(self_settings);
this.refreshViewAjax = Drupal.ajax(selfSettings);
};
Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () {
@@ -69,11 +67,11 @@
this.exposedFormAjax = [];
$('input[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) {
var self_settings = $.extend({}, that.element_settings, {
var selfSettings = $.extend({}, that.element_settings, {
base: $(this).attr('id'),
element: this
});
that.exposedFormAjax[index] = Drupal.ajax(self_settings);
that.exposedFormAjax[index] = Drupal.ajax(selfSettings);
});
};
@@ -92,12 +90,12 @@
$.extend(viewData, this.settings, Drupal.Views.parseQueryString(href), Drupal.Views.parseViewArgs(href, this.settings.view_base_path));
var self_settings = $.extend({}, this.element_settings, {
var selfSettings = $.extend({}, this.element_settings, {
submit: viewData,
base: false,
element: link
});
this.pagerAjax = Drupal.ajax(self_settings);
this.pagerAjax = Drupal.ajax(selfSettings);
};
Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response) {