I'm working on a site that is using the FAQ Field module and we are looking to migrate the content to another Drupal 7 instance.

When I am creating the mappings for my import feed, the field made of the FAQ Field instance does not show up in the Target drop down list. This is because there is no FAQ Field mapper file to define the field type in /sites/all/modules/feeds/mappers.

I have created this mapper and tested it just enough to have it work on my environment. I'd like to present it here for review, testing, tweaking and what-not.

#3 feeds_importing-content-from-faqfield_2053733-3.patch2.76 KBkarenann
PASSED: [[SimpleTest]]: [MySQL] 4,505 pass(es). View
#2 feeds_importing-content-from-faqfield_2053733-2.patch2.67 KBkarenann
PASSED: [[SimpleTest]]: [MySQL] 4,509 pass(es). View
#1 feeds_importing-content-from-faqfield_2053733-1.patch2.73 KBkarenann
PASSED: [[SimpleTest]]: [MySQL] 4,503 pass(es). View


karenann’s picture

Status: Active » Needs review
2.73 KB
PASSED: [[SimpleTest]]: [MySQL] 4,503 pass(es). View

I'm not sure if I did this right, so I'd love some feedback.

Important Notes:

  • I am exporting the faqfield data through Views Data Export into a CSV file.
  • The exporting view is set to output the faqfield data in the format of Simple Text (themeable)
  • The exporting view uses the FAQ Fields default format of theme_faqfield_formatter
      function theme_faqfield_formatter($variables) {
        $output = '<h3 class="faqfield-question">' . $variables['question'] . '</h3>';
        $output .= '<div class="faqfield-answer">' . $variables['answer'] . '</div>';
        return $output;
  • The exporting view is set to display multiple fields inline and I have the separator set to --break--
  • The import uses Feeds Tamper to "Explode" on the --break-- separator
karenann’s picture

2.67 KB
PASSED: [[SimpleTest]]: [MySQL] 4,509 pass(es). View

I realized that I had a few errors. Please review this instead. Changes include:

~ changed split to explode
~ removed trailing line breaks
~ replace tabs with spaces

karenann’s picture

2.76 KB
PASSED: [[SimpleTest]]: [MySQL] 4,505 pass(es). View

Another issue resolved:

~ added a continue in the event that the faqfield is blank.

MegaChriz’s picture

Title: Importing content from the FAQ Field type » Feeds integration: mapper
Project: Feeds » FAQ Field
Version: 7.x-2.x-dev » 7.x-1.x-dev
Component: Feeds Import (feature) » Code
Issue summary: View changes
Status: Needs review » Needs work

Mappers for fields or properties provided by a contrib module, should go in that contrib module, so moving this issue to the FAQ Field issue queue.

This patch also needs to be updated to follow these change records: