try this:
'pagetitle' => strtolower($wuid),
'alias' => strtolower($wuid)
http://www.php.net/manual/en/function.strtolower.php
After testing this a bit more. The page that is generated isn't accessible at all, regardless if the username is lowercase or not.
If I select preview from the manager immediately after it is generated, I get 35.php instead of, dusman.php (these being my example I'm working with). However, once I edit and save (no changes) it pops right in. If I preview again, after doing edit/save, then it shows dusman.php.
Accessing the URL directly doesn't work either, until I edit/save.
It seems to me I might be missing a system event in my plugin? The only one I have selected is OnWebSaveUser.
[ed. note: nuwebstudios last edited this post 15 years ago.]
Can anyone help with this?
I'm not sure how Evo handles this, but in Revo, I think new pages created directly in the DB aren't in the document map yet so they're not accessible to requests. Editing them and saving them would put them there.
Have you tried accessing them from another browser? A new session might refresh the document map.
Another solution might be to set the ID in a $_SESSION variable and forward the user to another page containing a snippet that reads that session variable and forwards the user on to the page with $modx->makeUrl() and $modx->sendRedirect().
Clearing the cache at the end of your snippet might solve the problem, but I can't remember how to do that in Evo and I might be completely off base on the whole thing.
I've narrowed this down to friendly URLs not working properly until after the edit/save routine being done. I can access the file through non-friendly url index.php?id=35. Is there any additional PHP I could add in my plugin or a system event I could fire that would engage friendly urls?
[ed. note: nuwebstudios last edited this post 15 years ago.]
BobRay, I think you are on the right track. It doesn't matter how I access the page, it simply isn't available until after I've edited/saved the document.
I also noticed that the System Event OnBeforeDocSave that it states "$id - Unique ID of the document. Note: this is empty if new document"
Should I perhaps be firing this system event with some additional code in my plugin?
Another update.. which leads me to think you are on the right track BobRay. I created multiple pages this time, which as expected aren't accessible. When I edit/save one.. both become accessible.
I don't think firing other System Events will help you. They don't really do anything but provide hooks for plugins.
Any ideas to some alternatives I could look at?