Forums not exported/imported
| Project: | Import / Export API |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
When forums are exported, the XML file is missing entries and when they are imported back, they simply dont' work. This is because the SQL that gets generated for exporting forum_revisions throws an error.
SQL query is as follows:
SELECT nr.nid, nr.vid, nr.uid, nr.title AS title_revision, nr.body, nr.teaser, nr.log, nr.timestamp, nr.format, nr.title AS forum_vid_title_revision, fo.vid AS forum_vid, fo.nid AS forum_nid, fo.tid AS forum_tid, n.title, n.title AS forum_nid_title, u.name, u.mail, ff.name AS format_name, td.name AS term_name FROM {node_revisions} nr LEFT JOIN {forum} fo ON nr.vid = fo.vid AND n.nid = fo.nid LEFT JOIN {node} n ON nr.nid = n.nid LEFT JOIN {users} u ON nr.uid = u.uid LEFT JOIN {filter_formats} ff ON nr.format = ff.format LEFT JOIN {term_data} td ON fo.tid = td.tid
Left Join for forum happens before the left join for node happens. When left join for forum table happens it referes to node.nid which has not arrived yet because node table has not joined yet. This means that the order of the left joins is important while the sql query generation is not taking care of the order of left joins.
The forums definition file for revisions make references like this:
<revisions>
revisions.nid -> node.nid
vid
...
forums.vid -> revisions.vid
forums.nid -> node.nid
...
</revisions>
#1
Hi Sunil,
I'm trying to export out my forum posts using the import/export API, did you find a workaround to the problem?
Phil