Closed (fixed)
Project:
Panels Pane Report
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
10 Jan 2017 at 18:28 UTC
Updated:
11 Jan 2017 at 17:22 UTC
Jump to comment: Most recent, Most recent file
Based on changes made recently #2833586: Allow for searching by title, it should be safe to remove all references to page_status and page_title in the following code (src/panels_pane_report.class.inc lines 142-167):
// If entity exists but is not referenced anywhere, mark it.
$is_mini_panel = $panel->storage_type == 'panels_mini';
if (!isset($panel->storage_id) || $is_mini_panel && !isset($config['nid'])) {
$panel->storage_id = self::NODE_UNREFERENCED;
$page_status = NODE_NOT_PUBLISHED;
$page_title = '';
}
elseif ($is_mini_panel) {
$result = db_query('SELECT status, title FROM {node} WHERE nid = :nid', array(':nid' => $config['nid']), array('target' => 'slave'))->fetchAssoc();
$page_status = $result['status'];
$page_title = $result['title'];
}
else {
$result = db_query('SELECT status, title FROM {node} WHERE nid = :nid', array(':nid' => $panel->storage_id), array('target' => 'slave'))->fetchAssoc();
$page_status = $result['status'];
$page_title = $result['title'];
}
// Add instance to map.
$pane_mapping[$storage_key]['instances'][] = array(
'panel' => $panel,
'build_mode' => isset($config['build_mode']) ? $config['build_mode'] : '',
'style_mode' => isset($style['style']) ? $style['style'] : '',
'page_status' => $page_status,
'page_title' => $page_title,
);
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | panels-pane-report-2842476-remove-unneeded-code-2.patch | 2.26 KB | WidgetsBurritos |
Comments
Comment #2
WidgetsBurritos commentedThis is a little bit of cleanup related to the changes made in #2833586: Allow for searching by title. Since the `page_status` and `page_title` values are not ever used, we can just scrap several lines of code.
Comment #3
pobtastic commented+1
Comment #5
WidgetsBurritos commentedComment #6
WidgetsBurritos commented