Closed ObscurusGrassator closed 2 years ago
Can you provide specific steps to reproduce this? I'm able to create a page using those characters.
Okay, so this only seems to happen when the page is unpublished -- only saved as a draft and previewed. In the short term you can manually edit the slug field to not include diacritics. We will log this to work on a fix. I'm not sure when it will be prioritized, so we'll welcome contributions.
Hmm, in that situation Apostrophe's serveNotFound
method kicks in and
checks if the desired slug does exist as a draft page, and if so redirects
there. Perhaps that logic has a problem with diacritics, although I don't
know why; that's the right place to look though.
(Worth making sure it still works for ordinary slugs too!)
On Fri, Oct 15, 2021 at 12:56 PM Alex Bea @.***> wrote:
Okay, so this only seems to happen when the page is unpublished -- only saved as a draft and previewed.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/3488#issuecomment-944452227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27OATBW3IFYAGPB5RDTUHBMM3ANCNFSM5GBWR4UQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his
Looked into it. The problem is with URL decoding.
Express automatically decodes the values in req.params
(using decodeURIComponent
). In the serveNotFound
function new params
are constructed from req.path
which is not decoded.
Good diagnosis! Would you be interested in doing a PR?
When using special characters(diacritic f.e. šččťžžý) in page title of a new page and saving it as draft we get an error: "We're sorry. We couldn't find the page you're looking for."
Apostrophe 3.6.0 Node v16.9.1 Mac + Linux + Windows