Closed mueller-sebastian closed 3 years ago
Thanks for the good bug report.
You are right, it won't work with written month or even single integer month. I'm not that happy with the whole date routing implementation in general, so I'm open for any ideas how to improve this!
Can you elaborate on the datePrefixRegex configuration you have in mind? Or even provide a PR?
pull request is created. Not sure if you will get a notice since one test seems to be on hold?!
I've received a notification. I will take a look asap.
Closed with merging #244 manually. Again, thanks for the contribution!
@mueller-sebastian
One thing I'm not sure about: in your example we end up with first letter uppercase month names. URLs should be lowercase IMO. Seems using https://www.php.net/manual/en/datetime.format.php does not allow to use lowercase month names. Any ideas about this? We could add a "transformToLowercase" option.
I've added an example based upon your date format, see 383db81794119d3a71d0f49431a9d07da23eb19a
Yes, I see only the two options: always cast to lowercase (less configruation but not possible to get uppercase) or add an option. I think an option is a good way to go.
Agree. Added in master branch :-)
TYPO3: 10.4.12 t3extblog: 6.1.1
When using the following datePrefix, the PostMapper is not able to resolve the post. datePrefix: 'Y/F/'
( = 2021/January)
Problem: When calculating the length of the date part to be stripped from the url, the current date is used.
Since the string length of the current month is possible not the same as the month the post is off, the result is not correct. ( now = 2021/January, Post may use 2020/May)
Same problem should occur if month without leading 0 is used as datePrefix (not tested).
Maybe add a datePrefixRegex configuration to be used to strip the date prefix from the slug?