Skip to content

Commit

Permalink
Merge pull request #42 from jinghao/master
Browse files Browse the repository at this point in the history
Fix drupal6-to-jekyll migrations
  • Loading branch information
mattr- committed Jul 16, 2013
2 parents 03664c3 + 46cde73 commit deca4cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/jekyll/jekyll-import/drupal6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ module Drupal6
nr.body, \
n.created, \
n.status, \
GROUP_CONCAT( td.name SEPARATOR ' ' ) AS 'tags' \
GROUP_CONCAT( td.name SEPARATOR '|' ) AS 'tags' \
FROM node_revisions AS nr, \
node AS n \
JOIN term_node AS tn ON tn.nid = n.nid \
JOIN term_data AS td ON tn.tid = td.tid \
LEFT OUTER JOIN term_node AS tn ON tn.nid = n.nid \
LEFT OUTER JOIN term_data AS td ON tn.tid = td.tid \
WHERE (n.type = 'blog' OR n.type = 'story') \
AND n.vid = nr.vid \
GROUP BY n.nid"
Expand Down Expand Up @@ -59,7 +59,7 @@ def self.process(dbname, user, pass, host = 'localhost', prefix = '')
node_id = post[:nid]
title = post[:title]
content = post[:body]
tags = post[:tags].downcase.strip
tags = post.fetch(:tags, '').downcase.strip
created = post[:created]
time = Time.at(created)
is_published = post[:status] == 1
Expand All @@ -73,7 +73,7 @@ def self.process(dbname, user, pass, host = 'localhost', prefix = '')
'layout' => 'post',
'title' => title.to_s,
'created' => created,
'categories' => tags
'categories' => tags.split('|')
}.delete_if { |k,v| v.nil? || v == ''}.each_pair {
|k,v| ((v.is_a? String) ? v.force_encoding("UTF-8") : v)
}.to_yaml
Expand Down

0 comments on commit deca4cf

Please sign in to comment.