1
我正試圖在一個Drupal 7次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)中修改過濾器值的任何想法。
此外,請求回答爲什麼訪問「受保護的屬性」正在發生。我是一名編碼員。我不想要任何保護!
在此先感謝!