jekyll / jekyll-import

:inbox_tray: The "jekyll import" command for importing from various blogs to Jekyll format.
https://import.jekyllrb.com
MIT License
515 stars 316 forks source link

Drupal 7 does not include author name/email in posts #550

Open lyndseypadget opened 2 weeks ago

lyndseypadget commented 2 weeks ago

OS: M1 apple chip macos, Sonoma 14.7 Ruby version: 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin23] Jekyll version: 3.10.0 Jekyll import version: 0.24.0

Importer: drupal7

I am importing posts (nodes) from a Drupal 7 database. The local version of this DB is running in a Docker container, MySql 8.0.39.

Because the Drupal 7 blog contained thousands of posts from hundreds of authors, I need the author information. This can be found in Drupal's users table, and is cross-referenced by the uid of the node. I am not a Drupal expert but I believe this relationship (between the node and users table) is reliable in all cases, and that the users table should contain at least a name and email.

For my purpose, I only need u.name (where u is an alias to the users table, and the name value is in the format first.last). I can see how u.mail (which is email address) would also be helpful, though.

I know how to fix this, and I will make a quick PR. However, I am also not a ruby developer, and the instructions to test don't work for me because

  1. I cannot find script/console as described in the Contributing page and
  2. I get a make error for dependency hpricot-0.8.6. This is likely due to the fact that I'm on an M1 mac, or I need to do a custom install/build of hpricot, or something.

Given the simple nature of the change and the testing issues I'm facing, I am hoping that someone can guide me through the process of testing this, or provide a build for me to install and test. 🙏

parkr commented 2 weeks ago

Hi! Thanks for the thoughtful issue and the pull request. Our tests and our contributing guidelines are quite old and subpar, apologies!

In general I think including the metadata about who wrote the post is a great idea. I haven't used drupal in a long time so I couldn't tell you if the table and field names are correct for either version. My general philosophy for testing these importers is that we should create mock databases or export files (whatever the system is we're importing from) and generate an output site we'd expect with all the metadata and post content. That's a relatively big lift, though, if it's not already setup.

I allowed the workflows on your PR to run for now and that should give you an environment to ensure existing tests pass & iterate on new tests.