We started to work on the D8 port, anyone interested can check at https://github.com/md-systems/redirect.

Current status is that "it works as defined but we need more manual testing" especially with cross language redirects.
See https://github.com/md-systems/redirect/issues/53

Improvements / refactorings:

  • D8 file structure was adopted
  • hook_menu has been ported to routes (with local_tasks and local_actions)
  • variable_get/set were replaced by config
  • redirect entity has been defined
  • tests were refactored to follow D8 pattern and made runnable
  • Merged GlobalRedirect module functionality
  • Improved multi language redirect situation.
  • Redirects working on sub directories.
  • Redirect list converted into a view with exposed filters.
  • External redirects working as expected.
  • Loop detection refactored
  • Improved hash upgrade path
  • Stored created date/time

We will update this issue about the progress. Anyone interested in joining us can do a pull request at the github repo linked above.

Comments

blueminds’s picture

Issue summary: View changes
miro_dietiker’s picture

Good news: Hard work is going on in our github repository! :-)

We're going to push development this week and expect to complete the redirect port with some minor leftovers.

Expect an update latest on friday for a pull request. We also do like to see a 8.x branch and dummy dev release here ASAP to allow to create followup tickets in the issue queue.

blueminds’s picture

Status: Active » Needs review

The current state of the D8 port can be considered as the initial port that works and has most of the functionality of D7 but still needs some work. So here is the status:

Done:
- Redirect entity and the UI to manage it.
- The source and redirect info is now stored using the Link module (needs patch from #2054011: Implement built-in support for internal URLs)
- Fix 404 pages UI.
- The settings page.
- Automatic redirects created when path changes or node/term alias is updated
- We have the redirect logic with logging the last access and count increment and the retain query through redirect feature

All the above has full test coverage either UI, API or Unit.

TODO:
- All around the D7 redirect module are alter hooks. Currently none of them have been ported. There are two reasons for that: 1) some of the original hooks can be replaced by the standard entity hooks 2) are they all needed?
- We do not do the redirect_can_redirect() yet. That logic needs to be implemented in the event subscriber. Also this seems to me the only place where some alter hook makes sense - let other modules say if there are some other paths that cannot be redirected.
- Allow redirects to be saved into the page cache is not implemented
- Automated deleting of redirects is not ported, but might work.
- Merge in the global_redirect functionality
- There is redirect_entity_type_supports_redirects() which I think does not make sense, mainly due to hardcoded form alters for term, node and path forms. If there are other modules that want to create redirects there is the Redirect entity that can be used. I would drop this function. This is also related to deleting of redirects in case the related entity gets removed.
- The redirect list is currently just a simple list without paging or search. We need to provide at least the search and pagination features.
- Do check for redirect loops.
- The redirect.module file needs to be reviewed - that is removing obsolete code and if I missed anything above add more todos/followups.
- The redirect.admin.inc file needs to be reviewed if all the UI functionality has been ported.
- Finalizing the Views integration.
- Devel integration
- Drush integration

blueminds’s picture

One down - redirect_can_redirect() is now ported.

blueminds’s picture

Another big one down - entity integration is now done via entity_presave() where we check if there is path field, and if so we observe it in case it changed.

miro_dietiker’s picture

dave reid’s picture

StatusFileSize
new14.43 KB

The local action on 404 pages seems to be missing:

dave reid’s picture

Redirects with query strings don't seem to be working. I created a redirect from 'this-is-a-404-page' to '' and while navigating to this-is-a-404-page works, it doesn't work if I go to this-is-a-404-page?foo=bar.

dave reid’s picture

If I create a redirect with '' as the destination URL, when I re-edit the redirect, the 'To' field is now an empty string.

blueminds’s picture

Hi Dave, very happy to see some feedback from you! Can we also have the 8.x branch so that we are able to create tickets for the correct version? Also the initial push into the repo would help to start regular work cycles. Or do you want us to first fix the issues you pointed out? Or they can be solved as a regular bug reports, as many others that I expect will follow. Thanks!

miro_dietiker’s picture

Hint: Global Redirect 8.x went in. nicholasThompson did the merge / release.
I'm looking forward to further progress.

pere orga’s picture

In my opinion we should have 1 redirect module in Drupal 8 and not 2. Could we join the forces in a single project?

pere orga’s picture

I created an issue in the Global Redirect module #2306621: Join forces with Redirect module

miro_dietiker’s picture

Pere Orga, we decided that we first want a straight port of redirect in the D8 repo.
For now we maintain redirect as mostly straight port on github till one of the maintainers merge it in.

Once it is in, we are open to push merging global redirect features into redirect itself and help with its maintenance.

pere orga’s picture

Status: Needs review » Needs work

ok cool. It's great to see some work done on the Drupal 8 version. However I'm not sure if would make more sense to do some rewriting (and release a stable release) of the 7 version instead, first.

Were the issues pointed by Dave fixed?

miro_dietiker’s picture

Pere Orga: People are pushing Drupal 8 forward. Adding features in Drupal 7 with port is just extra work and risk to break things with upgrading and more.
If you like to add new features and do things differently, focus on Drupal 8 as there is still room for new things and maintainers are less conservative yet. The module constantly improves on github with help of the community.

The issue about integrating global redirect into redirect is stale for years. I doubt this will change for D7. However, if you plan to push this forward on your own or funding people doing so, pick your preference. I still recommend though to negotiate with the maintainers first.

pere orga’s picture

IMHO, for Drupal 8, we should take the opportunity to do a major rewrite and maintain a single module, and not two.

This module has 180 issues open for the Drupal 7 version. If it's true that adding new features and improving it is not the current plan, the project page should be updated. However, I don't consider that doing that would be 'extra work'. Not more 'extra work' than starting a D8 version now. But pick your preferences you too.

blueminds’s picture

Hi Pere, I am sorry we have not first fixed the 7.x feature requests for you. But it somehow happened that we needed the 8.x version and we did not realize that working on it would make you upset. However, if you do not consider working on the remaining 7.x issues as 'extra work' you are probably a magician coder and you sure can do it by yourself. Unfortunately we are not that cool and fixing those 180 open issues would definitely be extra work for us.

RE merging global redirect - i personally started working on it and we will complete the work when the time is right. For now we decided to maintain the port on github till the module and Drupal itself is stable enough. Other people like Kim Pepper started to contribute. Thanks a lot!

pere orga’s picture

@blueminds I don't see the point of your message, I'm not upset in any way. And this was not about fixing it for 'me' or for 'you'. And I'm not a magician coder either, but more a Drupal newbie.

I will be working part-time starting next month so I can be active in the issue queue of some modules, Redirect included. Feel free to submit patches to the 7.x branch, I will try to review them.

blueminds’s picture

ah, sure...

pere orga’s picture

Yes, sure. And by the way, this project is seeking co-maintainers, you can create a ticket and propose yourself as a maintainer of the D8 version, if that's what you want.

ebeyrent’s picture

Any plans to release a dev version for d8 on the project page?

jhedstrom’s picture

The github repo doesn't have issues enabled, but does have PRs enabled. In order not to duplicate effort, would it be possible to turn issues on in the github repo?

berdir’s picture

Enabled.

damienmckenna’s picture

Title: D8 port » Port Redirect module to Drupal 8

Standardized the title.

pedrorocha’s picture

Just to give feedback: i'm using it in production to fix 404 errors after migrating a website from D7 to D8. If anyone needs only this basic feature, it's already good to go.

miro_dietiker’s picture

Updating the status of this issue:
#2548075: Globalredirect 8.x-1.x has been merged into redirect

And yeah sure it is very well progressed and significantly improved over the D7 version.
The only real blocker that we are aware of are significant bugs in multilingual behavior.

We will continue maintaining it at github until the maintainers merge back. Once it is back on d.o, we will also continue to work in the queue.

sk33lz’s picture

It would be great to see a Drupal 8 branch and dev release created at this point now that we have hit RC1 core. That way we can start rolling patches to bring in all the work from Github like we have for Pathauto and be more prepared for D8's upcoming release. Thanks!

miro_dietiker’s picture

Priority: Normal » Critical
Issue tags: +Needs issue summary update

We are working hard and keeping up with maintenance of the github repository.

Tagging this issue to need a summary update. Anyone can start with that. List things achieved, Test it and list things that need attention.
Out of my mind, things that are pending
- Currently in progress is a review after a most recent fixing of multilingual situation...
- And i personally want to check if we can add (optional) multi domain capability.

Raising priority for issue visibility.

giancarlosotelo’s picture

Issue summary: View changes

The module has been tested a lot and I think most of the functionality is working well. Updating the summary but probably there are many improvements more...

hass’s picture

@miro: Please leave github behind and push your code here. Only here we have automated tests running.

miro_dietiker’s picture

@hass please read through the history.
I have no access permission to d.o.. We are awaiting maintainer review for the port. Also if you checkout our github repo, you will magically find travis CI running! :-)

@giancarlosotelo you might want to go through the closed pull requests on github and list some of the major improvements / refactorings from there.

To merge back, i fear a statement "it works partially" is not satisfying. We need to state "it works as defined with the following exceptions" and list the action points in detail.

hass’s picture

d.o has a feature - request co-maintainer-ship. If the maintainer does not answer, move to infrastructure and take over the project.

giancarlosotelo’s picture

Issue summary: View changes

More updates.

sachbearbeiter’s picture

Is here still some feedback of the maintainer missing?

dave reid’s picture

FYI, I'll take a look at this after finishing the review of the Pathauto port.

mikeohara’s picture

I am also interested to see where this is at, and if anything is needed to get this done

allella’s picture

The conversation about the D8 port is going on at
https://www.drupal.org/node/2574049

kokrull’s picture

Thanks

dave reid’s picture

Status: Needs work » Fixed

I just pushed the 8.x-1.x branch from https://github.com/md-systems/redirect back here to Drupal.org and will be filing beta-blocking issues. As such, I'm going to mark this issue as fixed, and we should be filing patches and separate issues with the 8.x-1.x branch for any remaining issues.

miro_dietiker’s picture

Awesome. Happy this is officially available now, thx Dave!
I marked our repo as deprecated, pointing to the project page.

(Please also enable the 8.x branches visibility on project page.)

dave reid’s picture

StatusFileSize
new32.25 KB

When I can, I will:

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.