- 🇬🇧United Kingdom a.hover
Update the patch above to bring inline with 1.9 release and to prevent duplicate update hook.
This is not a bug per se in Redirect, but either a bug or a limitation of http-foundation in symfony.
http foundation used to use an isRedirection function to validate redirect
?>
/**
* Is the response a redirect?
*
* @return bool
*
* @final since version 3.2
*/
public function isRedirection()
{
return $this->statusCode >= 300 && $this->statusCode < 400;
}
but now they use an isRedirect function that leaves out code 300
/**
* Is the response a redirect of some form?
*
* @param string $location
*
* @return bool
*
* @final since version 3.2
*/
public function isRedirect($location = null)
{
return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location'));
}
Which means that if you have the option " Enforce clean and canonical URLs." and default redirect Status 300 set up in the redirect module, and you visit an url triggering a redirect (for instance ending in a slash), you will get a PHP fatal error and:
InvalidArgumentException The HTTP status code is not a redirect.
I'm opening this issue to inform drupal folks, while looking into a pull request for the http-foundation library to ask for explanation about 300 not being supported. In the meantime, maybe we should disable that combination of options? Or maybe make 302 the default code at least so folks checking the checkbox Enforce clean and canonical URLs don't get a broken site by default?
Update:here is the pull request to support code 300 in http-foundation.
Needs work
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Update the patch above to bring inline with 1.9 release and to prevent duplicate update hook.