-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Notice: Undefined index: responsive_toggle #112
Comments
@labboy0276 can you check this out? |
@maxplus I would try updating panopoly and see if that helps first |
@maxplus Did you try updating your panopoly? |
After updating kalatheme . |
Hi, But I do have another issue on this new project: #119 |
I'm getting this NOTICE also, Panopoly 7.x-1.10, Kalatheme 7.x-3.0. I tried resaving my views, but this didn't fix anything. |
Hi, |
Hi I did some more testing:
|
Same issue here. Also, I noticed some issues with the new views tpl (for grids by example) and the module views_bootstrap that already have his own tpl. |
Still have this error (7.x-4.x). The error is in includes/views.inc line 47 and 58. I don't know where responsive toggle is supposed to come from (it's never in options?), but rewriting the code to use empty() instead of "!" will make the error go away. However I'm sure responsive_toggle is supposed to be a thing in the first place, so I don't know that this is a fix. I would submit a pull request but this seems too minor and I don't know what the real fix is, or even what the function does really. Code: /**
* Implements hook_preprocess_views_view_grid().
*/
function kalatheme_preprocess_views_view_grid(&$variables) {
$variables['gridsize'] = kalatheme_get_grid_size();
$responsive_tiers = array('xs', 'sm', 'lg');
foreach ($responsive_tiers as $tier) {
// A variable is considered empty if it does not exist or if its value equals FALSE
if (empty($variables['options']['responsive_toggle'])) {
$variables['options']['columns_' . $tier] = 1;
}
if ($variables['gridsize'] % $variables['options']['columns_' . $tier] === 0) {
$variables[$tier] = $variables['gridsize'] / $variables['options']['columns_' . $tier];
}
dsm($variables['options']);
}
// This is set using the default grid columns value not columns_tier.
if ($variables['gridsize'] % $variables['options']['columns'] === 0) {
$variables['md'] = $variables['gridsize'] / $variables['options']['columns'];
// We need to do ths too.
// A variable is considered empty if it does not exist or if its value equals FALSE
if (empty($variables['options']['responsive_toggle'])) {
$variables['lg'] = $variables['gridsize'] / $variables['options']['columns'];
}
}
} |
Sorry, didn't mean to unassign, not sure how that happened. |
The preprocessing function is looking for a var that's supposed to be set in the Kalatheme bs grid Views style override. This isn't being set for two reasons:
function kalatheme_views_plugins_alter(&$plugins) {
if (isset($plugins['style']['grid'])) {
$plugins['style']['grid']['handler'] = 'views_plugin_style_grid_bootstrap';
$plugins['style']['grid']['path'] = drupal_get_path('theme', 'kalatheme') . '/views/plugins';
$plugins['style']['grid']['file'] = 'views_plugin_style_grid_bootstrap.inc';
}
$plugins = $plugins;
} It's being called, but I'm not sure why it's not overriding the default.
function option_definition() {
$options = parent::option_definition();
$options['columns'] = array('default' => '4');
$options['alignment'] = array('default' => 'horizontal');
$options['fill_single_line'] = array('default' => TRUE, 'bool' => TRUE);
$options['summary'] = array('default' => '');
$options['caption'] = array('default' => '');
return $options;
} Is there a reason we can't just extend the default grid rather than using alter to completely override it? |
I am seeing this again in 3.1 gonna try and fix this real quick like |
Kalatheme Issue #112 Fix syntax to prevent Undefined index in views.i…
Hi,
i get the following Notice when loading a page that uses a views grid:
Notice: Undefined index: responsive_toggle in kalatheme_preprocess_views_view_grid() (regel 47 van /var/www/vhosts/toporedvps.maxplus.be/httpdocs/sites/all/themes/kalatheme/includes/views.inc).
I have tried to disable responsive toggle in my own subtheme but the notice does not go away.
I'm using:
The text was updated successfully, but these errors were encountered: