core icon indicating copy to clipboard operation
core copied to clipboard

Vanity URL's lookup by site is not case insensitive

Open vianneychacon opened this issue 10 years ago • 2 comments

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.

vianneychacon avatar Jun 23 '16 16:06 vianneychacon

Related to: https://my.dotcms.com/tickets/detail.dot?id=8290033a-5db6-448b-ae92-06ee8513f5a8

Steps to reproduce:

  1. Change the Site name from "demo.dotcms.com" to "myDEMO.dotCMS.com".
  2. Go to Website Browser and create a test page, e.g., /vanity-page-redirect
  3. Go to Vanity URLs Portlet and create a new Vanity URL like the next one
screen shot 2016-08-08 at 5 08 53 pm

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.

joseorsini avatar Aug 08 '16 21:08 joseorsini

PR: https://github.com/dotCMS/core/pull/9525 https://github.com/dotCMS/core/pull/9950

joseorsini avatar Aug 09 '16 16:08 joseorsini