- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmini-panel-content.sql
More file actions
Latest commit
37 lines (29 loc) · 1.38 KB
/
Copy pathmini-panel-content.sql
File metadata and controls
37 lines (29 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
drop temporary table if exists published_content, published_panelizer_nodes, panel_info, minis;
/* Get the current published version of the workbench moderated content */
create temporary table if not exists published_content (
selectnh.nid, nh.vidfrom workbench_moderation_node_history as nh
wherenh.published=1);
/* Get the current published version of nodes that use panelizer */
create temporary table if not exists published_panelizer_nodes (
selectpe.entity_id, pe.didfrom panelizer_entity as pe
left join published_content as pc on (pc.nid=pe.entity_idandpc.vid=pe.revision_id)
wherepc.nidis not null);
/* Get the panes in the panelizer content */
create temporary table if not exists panel_info (
select ppn.*, pp.panel, pp.type, pp.subtype, pp.shownfrom panels_pane as pp
left join published_panelizer_nodes as ppn onppn.did=pp.did
whereppn.entity_idis not null
andpp.type='panels_mini'
);
/* Get all the panes with mini-panels */
create temporary table if not exists minis (
selectpi.entity_id, pm.name, pm.did, pm.admin_titlefrom panel_info as pi
left join panels_mini as pm onpm.name=pi.subtype
wherepm.nameis not null
order bypi.entity_id
);
/* Get the contents of the mini-panels in published panelizer pages */
select distinctm.name, m.did, pp.type, pp.subtypefrom panels_pane as pp
left join minis as m onm.did=pp.did
where name is not null
order by did asc;