Vanity URL's lookup by site is not case insensitive
I've seen this problem after migrating a site to version 3.5. The Vanity URLs continue to be active, they are just not shown on the backend.
Working along with @joseorsini, the lookup should be case-insensitive around here.
Related to: https://my.dotcms.com/tickets/detail.dot?id=8290033a-5db6-448b-ae92-06ee8513f5a8
Steps to reproduce:
- Change the Site name from "demo.dotcms.com" to "myDEMO.dotCMS.com".
- Go to Website Browser and create a test page, e.g., /vanity-page-redirect
- Go to Vanity URLs Portlet and create a new Vanity URL like the next one
Once it's saved, the message indicating the Vanity URL was saved is displayed, however, nothing is listed there. The new virtual link has the Site name hardcoded in the url field, in lower case
# select * from virtual_link;
inode | title | url | uri | active
--------------------------------------+----------------------+-----------------------------------------+-------------------------------+--------
4b8c55de-a9c1-4fd6-ab7b-cb66d574ac6b | 404 Error Page | companyY.com:/cms404Page | /demos/404-override-test.html | t
5dd071ee-699c-43a1-b362-e87416fa740d | News | companyY.com:/MyNews | /news-events/index.html | t
010c3115-1e8a-422f-9991-198f1b7dc2aa | vanity-page-test-001 | mydemo.dotcms.com:/vanity-page-test-001 | /vanity-page-redirect | t
But the lookup in the DB, as @vianneychacon stated in his comment, is case-sensitive, so no results are displayed.
If we change the Site name from 'myDEMO.dotCMS.com' to 'myDEMOupdated.dotCMS.com', the Virtual Link definition will remain broken and won't be updated with the new Site Name. So, a batch update of Virtual Links doesn't work if the Site is updated.
The only way to bring it back is by changing the site name to an all-lowered case one, which should match the current Url in the DB. Otherwise, the Virtual Links won't be listed.
PR: https://github.com/dotCMS/core/pull/9525 https://github.com/dotCMS/core/pull/9950