【发布时间】:2011-11-15 03:55:12
【问题描述】:
我在尝试修改 Drupal 7 Views 3 过滤器中的值时收到此错误:
Fatal error: Cannot access protected property SelectQuery::$where in /Users/joe/Sites/sdgea/docroot/sites/all/modules/custom/sdge_video/sdge_video.module on line 275
这是导致此问题的代码:
function modulename_views_pre_execute(&$view) {
if (is_numeric($term_no)) {
// set the filter
$view->filter['tid']->value[$term_no] = $term_no;
// set the query
$view->query->where[0]['conditions'][2]['value'] = $term_no;
// set the build info
$view->build_info['query']->where->conditions[0]['field']->conditions[0]['field']->conditions[2]['value'] = $term_no;
//$view->build_info['query']->where->conditions[0]['field']->conditions[0]['field']->conditions[2]['value'] = $term_no; // <-- This line specifically is causing fatality.
}
}
可能是 D7 中某个超人物体 yada yada 的一部分。任何人都对我如何在视图 3 视图 (D7) 中修改过滤器的值有任何想法。
此外,还要求回答为什么会发生对“受保护财产”的访问。我是一名编码员。我不想保护任何东西!
提前致谢!
【问题讨论】:
标签: drupal drupal-7 drupal-views