I created a Panel page which use Views context to collect children of a term and pass the context to a pane. When I view the page, an error occured. It said that function taxonomy_get_term() not found on 'ctools/views_content/plugins/relationships/term_from_view.inc'. It looks like taxonomy_get_term() function has been replaced by taxonomy_term_load() in Drupal 7. Am I correct, or am I missing module dependencies or something?

After replacing call to taxonomy_get_term() function with taxonomy_term_load(), the error message disappear, but Panels is unable to pass the context from View context to any panes.

I am not an expert in Panels, but after comparing to another working plugin there is difference in returning context. Views context returns ctools_context_create('term', $term) whereas the working plugin returns ctools_context_create('entity:taxonomy_term', $term). And after replacing the code, Panels successfully passes the context to pane.

Is this correct or am I just lucky?

oh, btw I just found something this morning, the required context should be a view whose base table is "taxonomy_term_data". Currently, the base table is "term_data".

CommentFileSizeAuthor
#4 ctools-update_for_d7-1532054-4.patch1.88 KBdubois

Comments

gantenx’s picture

Title: Problems in Views Context » Term from View Relationship problems
merlinofchaos’s picture

Priority: Normal » Major

Looks like that relationship may not have been successfully ported to D7 from D6. Sigh.

hazah’s picture

The steps outlined seemed to have worked for me, any movement into committing a fix?

dubois’s picture

Version: 7.x-1.0 » 7.x-1.3
StatusFileSize
new1.88 KB

Sharing simple patch with the suggested changes for our build scripts.

dubois’s picture

Issue summary: View changes

found that the required views context base table is term_data.

bpiwowar’s picture

Version: 7.x-1.3 » 7.x-1.4
Issue summary: View changes

I can confirm the issue (in 7.x-1.4) and that the patch from @dubois is working.

b-prod’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Active » Reviewed & tested by the community

Patch from dubois fixes the issue (comment #4).
It applies well on the current DEV version.

japerry’s picture

Status: Reviewed & tested by the community » Fixed

Oh simple porting issue. Fixed.

  • japerry committed f7ff7f9 on 7.x-1.x authored by dubois
    Issue #1532054 by dubois: Term from View Relationship problems
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.