# Summary

This module allows to include path redirection in a simple way. Provides a simple way to bulk import redirects for the Redirect module from a CSV file.

Currently redirects can only be imported from the GUI via the BatchAPI. Also it is not possible to specify a language in the CSV for now.

# Project URL

https://www.drupal.org/project/path_redirect_import

# Where is the code?

https://www.drupal.org/project/path_redirect_import/releases/8.x-1.0-beta4
https://github.com/BurdaMagazinOrg/module-path_redirect_import

# Estimated completion date

Unknown

# Dependencies

Redirect

# Who's doing the port?

Burda Magazin Holding

# What help do they need?

  • D7 export functionality
  • Documentation / README
  • Handle decoded URLs

# D8 roadmap

# Background and reference information

Comments

tjwelde created an issue. See original summary.

mvc’s picture

I didn't fix the language issue or the drush command, but I improved the menus and got redirects to external URLs working:
https://github.com/BurdaMagazinOrg/module-path_redirect_import/pull/1

Bart Vanhoutte’s picture

I've created a fork and worked on the language support. I've also refactored the code a bit to have less in the global function namespace. See these URLs:

Can we get a dev version op on drupal.org?

mark_fullmer’s picture

Status: Needs work » Needs review

Another fork and pull request here: https://github.com/BurdaMagazinOrg/module-path_redirect_import/pull/3

This PR is a complete rewrite of the existing code, with the main goal of having all of the redirect import logic in a D8 service, to make writing tests easier and for separation of concerns.

This pull request also:

  • Includes the drush integration currently missing. Instructions for using the drush command are in the file, as per standards.
  • Provides language integration.
  • Supports a number of other path variants (such as external paths, , and duplicates) more fully. See, primarily the preSave($row) method in the ImporterService class.
  • Moves the menu item to /admin/config/search/redirect/import, to be consistent with the D7 module, instead of having it as a separate item in /admin/config/search/
  • Passes CodeSniffer standards
  • Includes verbose docblock comments

Still to do

(1) add the "export" functionality of the 7.x branch
(2) add unit tests
(3) add help text / README
(4) Memoize the check for existing Redirects (so that large imports don't do so many database queries)

Bart Vanhoutte’s picture

Can we get Mark's code on drupal.org as a development release so we can start using this?

HongPong’s picture

Hi all, I offered to co-maintain this module just now: #2847046: Offering to co-maintain Path redirect import - I would like to support your efforts by getting the mark_fullmer and BurdaMagazinOrg development onto an 8.x-1.x branch. Best regards.

tjwelde’s picture

Hi,

I'm sorry. I didn't have time (also was on holidays) yet.
@bart-vanhoutte I will test it and merge, if it looks alright.
@hongpong thanks for your offer. Did you already look at the code in the PR?

HongPong’s picture

Hi tjwelde yes I think I have a sense of the code now. I think it is a good start. I have some ideas like improving logging and documentation a bit.

tjwelde’s picture

Ok, the dev release is ready. I also added a beta release, since it is now quite mature.

We still need documentation and handling of decoded URLs: https://github.com/BurdaMagazinOrg/module-path_redirect_import/issues/4

tjwelde’s picture

Status: Needs review » Needs work
mark_fullmer’s picture

tjwelde’s picture

Hey mark. Did you want to comment sth? It doesn't show anything for me...

tjwelde’s picture

Issue summary: View changes
mgifford’s picture

Status: Needs work » Fixed

I don't see why this isn't fixed. I just ran a demo of the code and it worked fine. There is a 8.x-1.0-beta1 already.

mmjvb’s picture

Status: Fixed » Needs review

With a beta Status should be Needs review.
@mgiffors Suggest to read the description of the D8CPT project. It explains the usage of status for issues In this project.

mmjvb’s picture