Quick overview:

I've got Panel with path neighborhood/!tid

In the arguments tab, I've set %tid assigned "Taxonomy term (multiple): ID" as the context (note that event\ though the url path uses '!tid', the arguments tab lists it at '%tid').

If I check "Inject hierarchy of first term into breadcrumb trail" and visit the page without using the optional !tid argument in the path, I get this error:

Notice: Undefined property: ctools_context::$tids in ctools_terms_breadcrumb() (line 68 of /Applications/MAMP/htdocs/mysite/docroot/sites/all/modules/ctools/plugins/arguments/terms.inc).

It doesn't seem like the inherit options work with optional path arguments.

CommentFileSizeAuthor
#5 ctools-1326110-undefined_property.patch508 bytesmikeker

Comments

Letharion’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 7.x-3.0-alpha3 » 7.x-1.0-rc1
Component: Plugins - arguments » Code
Status: Active » Postponed (maintainer needs more info)

There's probably an isset() or so missing. Really looks like it belongs in the Ctools issue queue though.
@madmatter23: Please provide
1) the version of Ctools you're using, and
2) An export of a panel to reproduce the problem and
then reset status to active. :)

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
socialnicheguru’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Closed (cannot reproduce) » Active

I am using Ctools from June 28, 2012

here is the export of my view:

$page = new stdClass();
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'sng_events_day';
$page->task = 'page';
$page->admin_title = 'Day';
$page->admin_description = 'Events page';
$page->path = 'events/days/!date/!location';
$page->access = array(
'plugins' => array(
0 => array(
'name' => 'php',
'settings' => array(
'description' => 'Event Feature Enabled',
'php' => '// check to see if event feature is enabled
// if so then return TRUE and show the panel and menu item
// if not, then return FALSE and no menu item will be shown
return (TRUE);',
),
'not' => FALSE,
),
),
'logic' => 'and',
);
$page->menu = array(
'type' => 'tab',
'title' => 'Day',
'name' => 'main-menu',
'weight' => '2',
'parent' => array(
'type' => 'normal',
'title' => 'Events',
'name' => 'main-menu',
'weight' => '0',
),
);
$page->arguments = array(
'date' => array(
'id' => '',
'identifier' => '',
'argument' => '',
'settings' => array(),
),
'location' => array(
'id' => 1,
'identifier' => 'Location Taxonomy',
'name' => 'terms',
'settings' => array(
'breadcrumb' => 1,
),
),
);
$page->conf = array(
'admin_paths' => FALSE,
);
$page->default_handlers = array();
$handler = new stdClass();
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_sng_events_day_panel_context';
$handler->task = 'page';
$handler->subtask = 'sng_events_day';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Events Panel',
'no_blocks' => 0,
'pipeline' => 'standard',
'body_classes_to_remove' => '',
'body_classes_to_add' => '',
'css_id' => 'panel-events',
'css' => '',
'contexts' => array(
0 => array(
'identifier' => 'Location Taxonomy',
'keyword' => 'location_vocabulary',
'name' => 'entity:taxonomy_vocabulary',
'entity_id' => '51',
'id' => 1,
),
1 => array(
'identifier' => 'Logged in User',
'keyword' => 'user_logged_in',
'name' => 'user',
'type' => 'current',
'uid' => NULL,
'id' => 1,
),
),
'relationships' => array(),
'access' => array(
'logic' => 'and',
'plugins' => array(
0 => array(
'name' => 'role',
'settings' => array(
'rids' => array(
0 => 2,
),
),
'context' => 'logged-in-user',
'not' => FALSE,
),
),
),
);
$display = new panels_display();
$display->layout = 'threecol_15_70_15_stacked';
$display->layout_settings = array();
$display->panel_settings = array(
'style_settings' => array(
'default' => NULL,
'header' => NULL,
'left' => NULL,
'middle' => NULL,
'right' => NULL,
'footer' => NULL,
),
);
$display->cache = array();
$display->title = 'Events';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-1';
$pane->panel = 'middle';
$pane->type = 'views_panes';
$pane->subtype = 'sng_event_calendar-panel_pane_3';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'view_mode' => NULL,
'widget_title' => 'Day',
'items_per_page' => NULL,
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$display->content['new-1'] = $pane;
$display->panels['middle'][0] = 'new-1';
$pane = new stdClass();
$pane->pid = 'new-2';
$pane->panel = 'right';
$pane->type = 'views';
$pane->subtype = 'sng_event_calendar';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_pager_settings' => 0,
'use_pager' => 1,
'nodes_per_page' => '0',
'pager_id' => '0',
'offset' => '0',
'more_link' => 0,
'feed_icons' => 0,
'panel_args' => 0,
'link_to_view' => 0,
'args' => '',
'url' => '',
'display' => 'nodejs_block_2',
'context' => array(
0 => '',
),
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$display->content['new-2'] = $pane;
$display->panels['right'][0] = 'new-2';
$display->hide_title = PANELS_TITLE_PANE;
$display->title_pane = '0';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;

socialnicheguru’s picture

putting in a dpm statement there doesn't seem to be a $context->tids.
Also where is $current defined?

. (Object) ctools_context
type (Array, 2 elements)
0 (String, 5 characters ) terms
1 (String, 20 characters ) entity:taxonomy_term
data (NULL)
title (String, 15 characters ) Unknown context
page_title (String, 0 characters )
identifier (String, 14 characters ) Location Terms
argument (NULL)
keyword (String, 8 characters ) location
original_argument (NULL)
restrictions (Array, 0 elements)
empty (Boolean) TRUE
plugin (String, 5 characters ) terms
id (String, 16 characters ) argument_terms_3
placeholder (Array, 2 elements)
type (String, 8 characters ) argument
conf (Array, 5 elements)
id (Integer) 3
identifier (String, 14 characters ) Location Terms
name (String, 5 characters ) terms
keyword (String, 8 characters ) location
breadcrumb (Integer) 1

socialnicheguru’s picture

Issue summary: View changes

fixing grammar and formatting

mikeker’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new508 bytes

An oldie, but a goodie...

The attached patch checks the $context variable for existence of tids before using it. Essentially the same bug/patch as #1300666: Notice: Trying to get property of non-object in ctools_term_breadcrumb (line 145

damienmckenna’s picture

Moving this to the v7.x-1.10 release plan.

tuwebo’s picture

Hello,
Patch in #5 is working for me, thanks.

damienmckenna’s picture

mikeker’s picture

I'm a little confused... If the parent issue (7.x-1.10 release) is fixed, shouldn't this have been committed as part of that fix?

damienmckenna’s picture

Status: Needs review » Needs work

@mikeker: nobody RTBC'd the patch, so japerry didn't commit it.

I've reviewed the patch and have some feedback:

  • It checks to make sure that $context->data and $context->data->tids exist and are not empty, but the rest of that function doesn't actually use $context->data->tids? It does, however, use $context->tids[0], so is the if() patch wrong or is the rest of the code wrong?
  • The function defines $current->tid but doesn't define $current, it might be also worth setting $current = new StdClass() first.

If you'd mind looking into this again and working out an updated patch I'd be happy to review it.

mikeker’s picture

@DamienMcKenna: Sorry, I assumed that if a parent issue is marked as fixed, all it's child issues were fixed. Now I understand that's not the case. Thanks for the clarification!

I'll try to look at the issues you've mentioned in #13 but it may be a while as I don't have any D7 projects at the moment...