It would be nice to ignore redirection on language neutral nodes so they won't get a language prefixed URL.
Same feature as requested for Global Redirect https://www.drupal.org/node/2710863

Comments

rmarques created an issue. See original summary.

rutiolma’s picture

Initial patch. Tests needed.

rutiolma’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: ignore_language_neutral_nodes-2922534-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

rutiolma’s picture

StatusFileSize
new3.18 KB

New patch with bug fixes.

dev.patrick’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: ignore_language_neutral_nodes-2922534-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

berdir’s picture

This functionality will eventually move into core and I think it is very unlikely that it would be added there.

It doesn't really make sense, just because your content is language neutral doesn't mean that the site itself is, that still needs to have a language and be translated.

Any link that is generated by Drupal would still have a prefix, not having that is simply not correct.

rutiolma’s picture

@Berdir can you clarify the reason why a link should always have a prefix?

In my specific case, this is a critical issue because there should be a language neutral page (not necessarily a language selection page but behaving like it) and we can't show any sign of default or preferential language.

So for a specific neutral language content type, it should be possible to access it directly without a language prefix.
Do you see an acceptable way to do this?

berdir’s picture

Status: Needs work » Postponed (maintainer needs more info)

I see.

I think it is wrong because you have a set of language negotations rules, by not having a language prefix in the URL, all you do is fall back to the next, which might be browser language then it's going to an arbitrary language, or it will be the default language.

What redirect does support is route-based exclusions, you could have a custom route that serves your node/content and add the flag there to skip all of this. If you have a custom request subscriber that runs before redirect.module you could even add that at runtime to the normal node route and one specific node id, or being on the frontpage.

rutiolma’s picture

Thanks for the input.
I've created a module to create a route override, with a "_disable_route_normalizer" property, for language neutral content types. Tests still missing https://www.drupal.org/project/disable_route_normalizer