Describe the bug
When u give a date-field the field variable of "year" and u set Extras/Date Format to "Y" and Input Format to "YYYY" u are not able anymore to map the route with a wildcard anymore.
This issue (I am sure) does even occour when u want to let the users set the "year" with an integer.
The format of the field in this case does't matter - the NAME is the crucial thing.
To Reproduce
Reproduce it - like I said. But there is no need to.
Expected behavior
Statamic should realize - that in this case there is no DATE field - and year is just a field.
SOLUTION
Change in Data/Content/UrlBuilder.php on Line 108 - 125:
private function getSpecialValue($variable)
{
switch ($variable) {
case 'year':
$value = $this->content->date()->format('Y');
break;
case 'month':
$value = $this->content->date()->format('m');
break;
case 'day':
$value = $this->content->date()->format('d');
break;
default:
$value = null;
}
return $value;
}
Also I found out - that this causes problems in the vue - control panel. When I want to order my collection according to "year" now - I does not work. No error message. But just did not do it.
Describe the bug When u give a date-field the field variable of "year" and u set Extras/Date Format to "Y" and Input Format to "YYYY" u are not able anymore to map the route with a wildcard anymore. This issue (I am sure) does even occour when u want to let the users set the "year" with an integer. The format of the field in this case does't matter - the NAME is the crucial thing.
To Reproduce Reproduce it - like I said. But there is no need to.
Expected behavior Statamic should realize - that in this case there is no DATE field - and year is just a field.
SOLUTION
Change in Data/Content/UrlBuilder.php on Line 108 - 125:
To
Also I found out - that this causes problems in the vue - control panel. When I want to order my collection according to "year" now - I does not work. No error message. But just did not do it.