Duplicated sites with different title, same node

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

Duplicated sites with different title, same node

Recently I found a strange behavior in Alfresco. I reproduced the behavior when logged in ADF application on Internet Explorer changed the name of a site then logged in Chrome/Firefox and the changes can't be seen. I query the database using the following query:

SELECT n.id AS "Node ID",
       n.store_id AS "Store ID",
       n.uuid AS "Site ID (UUID)",
       p.string_value AS "Site Name",
       p1.string_value AS "Site Description",
       p2.string_value AS "Site Visibility",
       n.audit_created AS "Creation Date",
       n.audit_modified AS "Modification Date"
FROM alf_node AS n,
  alf_node_properties AS p,
  alf_node_properties AS p1,
  alf_node_properties AS p2,
  alf_qname AS q
WHERE n.type_qname_id=q.id
      AND p.node_id=n.id
      AND p1.node_id=n.id
      AND p2.node_id=n.id
      AND p.qname_id IN (SELECT id FROM alf_qname WHERE local_name='name')
      AND p1.qname_id IN (SELECT id FROM alf_qname WHERE local_name='description')
      AND p2.qname_id IN (SELECT id FROM alf_qname WHERE local_name='siteVisibility')
      AND q.local_name='site';

The results are:

The first two rows are the same with the same Site ShortName and same Node Id. The only things that are different is the Site Title.

What can be the cause ? How can be fixed?

3 Replies
Highlighted
Master

Re: Duplicated sites with different title, same node

You are not selecting the site title. You are missing the relevant "title" property for this. The name (short name) of a site can never be changed after creation. Whatever you are changing to rename a site is always the title.

Highlighted
Active Member

Re: Duplicated sites with different title, same node

Yes, you’re right about it but my problem is why it returns 2 sites of “hr” short name instead of one. This appears when I update a site title from IE. 

Highlighted
Master

Re: Duplicated sites with different title, same node

Your query performs a simple cross-join instead of a proper left-join. This unnecessarily duplicates the results. This is completely unrelated to Alfresco which performs a correct query.