md-systems / redirect

DEPRECATED: Redirect moved back to drupal.org, use the official repository.
https://www.drupal.org/project/redirect
21 stars 29 forks source link

When using different negotiation methods for interface and content, there are redirect loops #77

Open penyaskito opened 8 years ago

penyaskito commented 8 years ago

When using different negotiation methods for interface and content, there are redirect loops.

I tracked this down to redirectNormalizeAliases(), where we are checking if the used path is the same one than saved for the current system path. However, we call $this->languageManager->getCurrentLanguage() which defaults to interface language.

I think it should use $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT) instead.

Berdir commented 8 years ago

We might want to consider implementing https://www.drupal.org/node/2641118, likely allows us to throw out most if not all of our custom methods. We might lose some configurability however.

IT-Cru commented 8 years ago

Could this also be happen when some of our users has 'preferred_admin_langcode' NULL?

anavarre commented 8 years ago

No issue here with the below, so I suspect we're talking about preferred_langcode instead.

mysql> SELECT preferred_admin_langcode FROM users_field_data;
+--------------------------+
| preferred_admin_langcode |
+--------------------------+
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| en                       |
| en                       |
| en                       |
| en                       |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| en                       |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
| NULL                     |
+--------------------------+
37 rows in set (0.06 sec)

mysql> SELECT preferred_langcode FROM users_field_data;
+--------------------+
| preferred_langcode |
+--------------------+
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
| en                 |
+--------------------+
37 rows in set (0.00 sec)