On my local dev site the link resolves to wholesale/wholesale-info. But on the staging site, on the server staging.example.com the link does not work, because there is not a page called e2uM9I8ieVT5Mgf0.
I don’t understand why this link is not working.
I have other links, for example: <a href=\"/@/page/Bq6DZRJ7Xzmvi3f4\">Our story</a> And the template <?= $block->text()->permalinksToUrls() ?> t hat are working.
Hmm, the only way I’ve got this to work is to log in to the staging panel. Remove the link and recreate the link to the page.
Am I going to have to do this to every link to every page I have created on my local dev site? Any why? Surely creating a link to another page should be easy?
If you have an old link on the staging site and use caching, then something like that could happen.
The thing is, a UUID for a model (page, file, user) is created when the model is created. So say you create a page on dev and link to it, then copy that page to staging and clear the cache, all should be fine.
An issue would happen if you create a page on dev, link to it on dev, then create the same page also on staging, but copy the page with the link to the page from dev to staging. At that point, the link would stop working. So you need to make sure to keep your stuff between local and staging in sync.
I don’t understand because the staging site was empty. So it wasn’t out of sync. I uploaded everything from my local dev to the staging site. Another few hours trying to link to a page…
You say ‘If you … use caching’ – is caching optional? Can I turn it off? Is it off by default (I haven’t turned it on in the config.php file)? I seem to remember having problems with caching before.
So cache for UUID is on by default, but off by default for pages.
Note that when you use UUIDS (by default they are turned on), but disable the cache for UUIDs, the performance of finding the right page for a UUID will suffer.
Find the content txt file for wholesale/wholesale-info and look at the bottom of the file. There should be a UUID field. Does that have the UUID e2uM9I8ieVT5Mgf0 ? If not then something went wrong when you uploaded the website to the staging server. If you deleted and recreated the wholesale-info page on the staging server then it would have a different UUID to the local development version and would be the reason why it wasn’t working.