updated modules

views friendly_register serial address_field i18n
This commit is contained in:
Bachir Soussi Chiadmi
2015-05-26 19:56:22 +02:00
parent c9f8dc21ed
commit 706c96d663
58 changed files with 584 additions and 367 deletions

View File

@@ -206,14 +206,14 @@ class views_plugin_cache extends views_plugin {
// Slightly less simple for CSS:
$css = drupal_add_css();
$css_start = isset($this->storage['css']) ? $this->storage['css'] : array();
$this->storage['css'] = $array_mapping_func($css, $css_start);
$this->storage['css'] = $this->assetDiff($css, $css_start, $array_mapping_func);
// Get javascript after/before views renders.
$js = drupal_add_js();
$js_start = isset($this->storage['js']) ? $this->storage['js'] : array();
// If there are any differences between the old and the new javascript then
// store them to be added later.
$this->storage['js'] = $array_mapping_func($js, $js_start);
$this->storage['js'] = $this->assetDiff($js, $js_start, $array_mapping_func);
// Special case the settings key and get the difference of the data.
$settings = isset($js['settings']['data']) ? $js['settings']['data'] : array();
@@ -224,6 +224,38 @@ class views_plugin_cache extends views_plugin {
$this->storage['headers'] = $array_mapping_func(drupal_get_http_header(), $this->storage['headers']);
}
/**
* Computes the differences between two JS/CSS asset arrays.
*
* @param array $assets
* The current asset array.
* @param array $start_assets
* The original asset array.
* @param string $diff_function
* The function that should be used for computing the diff.
*
* @return array
* A CSS or JS asset array that contains all entries that are new/different
* in $assets.
*/
protected function assetDiff(array $assets, array $start_assets, $diff_function) {
$diff = $diff_function($assets, $start_assets);
// Cleanup the resulting array since drupal_array_diff_assoc_recursive() can
// leave half populated arrays behind.
foreach ($diff as $key => $entry) {
// If only the weight was different we can remove this entry.
if (count($entry) == 1 && isset($entry['weight'])) {
unset($diff[$key]);
}
// If there are other differences we override with the latest entry.
elseif ($entry != $assets[$key]) {
$diff[$key] = $assets[$key];
}
}
return $diff;
}
/**
* Restore out of band data saved to cache. Copied from Panels.
*/

View File

@@ -2140,7 +2140,7 @@ class views_plugin_display extends views_plugin {
'#default_value' => $pager['type'],
);
$pager_plugin = views_fetch_plugin_data('pager', $pager['type'], array($this->view->base_table));
$pager_plugin = views_fetch_plugin_data('pager', $pager['type']);
if (!empty($pager_plugin['uses options'])) {
$form['markup'] = array(
'#prefix' => '<div class="form-item description">',

View File

@@ -227,6 +227,8 @@ class views_plugin_display_attachment extends views_plugin_display {
$args = $this->get_option('inherit_arguments') ? $this->view->args : array();
$view->set_arguments($args);
$exposed_input = $this->get_option('inherit_exposed_filters') ? $this->view->exposed_input : array();
$view->set_exposed_input($exposed_input);
$view->set_display($this->display->id);
if ($this->get_option('inherit_pager')) {
$view->display_handler->use_pager = $this->view->display[$display_id]->handler->use_pager();

View File

@@ -1322,6 +1322,10 @@ class views_plugin_query_default extends views_plugin_query {
if (count($this->having)) {
$this->has_aggregate = TRUE;
}
elseif (!$this->has_aggregate) {
// Allow 'GROUP BY' even no aggregation function has been set.
$this->has_aggregate = $this->view->display_handler->get_option('group_by');
}
if ($this->has_aggregate && (!empty($this->groupby) || !empty($non_aggregates))) {
$groupby = array_unique(array_merge($this->groupby, $non_aggregates));
foreach ($groupby as $field) {