Issue #1824834 by vijaycs85, Albert Volkman: Covert default_nodes_main() variable to CMI system.
parent
871e6bd282
commit
5f4e5d8d26
|
@ -0,0 +1 @@
|
|||
items_per_page: '10'
|
|
@ -489,7 +489,6 @@ function node_uninstall() {
|
|||
variable_del('node_admin_theme');
|
||||
variable_del('node_cron_last');
|
||||
variable_del('node_recent_block_count');
|
||||
variable_del('default_nodes_main');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -711,6 +710,15 @@ function node_update_8008() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Coverts default_nodes_main variable to config.
|
||||
*
|
||||
* @ingroup config_upgrade
|
||||
*/
|
||||
function node_update_8009() {
|
||||
update_variables_to_config('node.settings', array('default_nodes_main' => 'items_per_page'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "addtogroup updates-7.x-to-8.x"
|
||||
* The next series of updates should start at 9000.
|
||||
|
|
|
@ -2369,7 +2369,7 @@ function node_page_default() {
|
|||
->orderBy('n.sticky', 'DESC')
|
||||
->orderBy('n.created', 'DESC')
|
||||
->extend('Drupal\Core\Database\Query\PagerSelectExtender')
|
||||
->limit(variable_get('default_nodes_main', 10))
|
||||
->limit(config('node.settings')->get('items_per_page'))
|
||||
->addTag('node_access');
|
||||
|
||||
$nids = $select->execute()->fetchCol();
|
||||
|
@ -2624,7 +2624,7 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
|
|||
$form['front_page']['default_nodes_main'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Number of posts on front page'),
|
||||
'#default_value' => variable_get('default_nodes_main', 10),
|
||||
'#default_value' => config('node.settings')->get('items_per_page'),
|
||||
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)),
|
||||
'#access' => (config('system.site')->get('page.front') == 'node'),
|
||||
'#description' => t('The maximum number of posts displayed on overview pages such as the front page.'),
|
||||
|
@ -2638,7 +2638,9 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
|
|||
* @see node_form_system_site_information_settings_form_alter()
|
||||
*/
|
||||
function node_form_system_site_information_settings_form_submit($form, &$form_state) {
|
||||
variable_set('default_nodes_main', $form_state['values']['default_nodes_main']);
|
||||
config('node.settings')
|
||||
->set('items_per_page', $form_state['values']['default_nodes_main'])
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,7 +46,7 @@ function taxonomy_term_page(Term $term) {
|
|||
drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url($uri['path'], array_merge($uri['options'], array('alias' => TRUE)))), TRUE);
|
||||
|
||||
$build['taxonomy_terms'] = taxonomy_term_view_multiple(array($term->id() => $term));
|
||||
if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {
|
||||
if ($nids = taxonomy_select_nodes($term->tid, TRUE, config('node.settings')->get('items_per_page'))) {
|
||||
$nodes = node_load_multiple($nids);
|
||||
$build['nodes'] = node_view_multiple($nodes);
|
||||
$build['pager'] = array(
|
||||
|
|
Loading…
Reference in New Issue