-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strtolower on slug #32
Comments
I know this one is 9 months old, so if you've already found a fix my apologies. I've been seeing the same problem, and I believe I'm narrowing in on the issue. The quick solution is to have your slug (file name) be exclusively lower case. The longer answer has absorbed a number of hours this evening/morning now, but I believe is traced to the fact that the slug only gets passed through strtolower in Post::expected_source_filename(). I believe that this function doesn't get run on new posts before the hook is called, thus the $slug referenced by the hook isn't in lower case, however as part of the Updater process the function does get called leading to the links on the home page being correct but those available to hooks being incorrect. There are several different possible solutions:
This seems 'hacky' and like its not solving the real issue...
This seems less 'hacky' to me, but I'm not clear if there was a reason for waiting to make the slug lowercase until Post::expected_source_filename()
I'm leaning towards option number 3, and after I get some sleep I'll test it further to see if it breaks anything, and possibly submit a pull request with the change to see what Marco thinks (assuming he has time/interest). |
I just found out that sometimes the slog does not get set in lower case. How I found it:
Hope this is accurate enough. I don't know where to search for the error. Maybe someone knows. Looking forward to a fix.
The text was updated successfully, but these errors were encountered: