jekyll / jekyll-import

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

Drupal 8 url_alias table #466

Closed joncamfield closed 2 years ago

joncamfield commented 2 years ago

The jekyll Drupal8 importer appears to look for the url_alias table, which has been replaced by a new path_alias table, and the source field is now called path. Some Drupal-y links: https://www.drupal.org/project/xmlsitemap/issues/3117561 ; https://www.drupal.org/project/pathauto/issues/2696813

From the user's perspective, this generates errors such as

table url_alias doesn't exist and Unknown column 'source' in 'field list'

A quick solution for users is to (in the D8 DB) copy the path_alias table to a new url_alias table, and also rename the path column to source

An ideal solution would be a failure case to check for path_alias if url_alias is not found, and then pull using the updated field names.

(that said, thank you for the importer!)

parkr commented 2 years ago

From https://www.drupal.org/project/xmlsitemap/issues/3117561:

This should probably add a composer.json line locking this change to >= 8.8 since the opposite break will be true if someone tries to run the updated module in 8.7 :-/

Sounds to me like Drupal <8.7, use url_alias table and for Drupal >=8.8, use path_alias table. And they renamed a column. It's unfortunate that they changed the table name and renamed the column before Drupal 9.

Our code has this particular table referenced here:

https://github.com/jekyll/jekyll-import/blob/ac0c8eb4285ad4dd5912314700673e0b9d7fe6a3/lib/jekyll-import/importers/drupal8.rb#L47-L49

And then processed here:

https://github.com/jekyll/jekyll-import/blob/ac0c8eb4285ad4dd5912314700673e0b9d7fe6a3/lib/jekyll-import/importers/drupal_common.rb#L126-L134

I think the best option here is to let the user either (1) select their Drupal minor version and we automatically switch or (2) we let them choose the table they want to use with helpful documentation indicating that <8.7 should use url_alias and >=8.8 should use path_alias.

jekyllbot commented 2 years ago

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.