[opencms-dev] Fix for bug id 28 for version 5.0.0

Olli Aro olli.aro at clicksandlinks.com
Wed Aug 25 18:44:38 CEST 2004


Thanks Brett,

 

This helped me to repair the database. However my modules use the property
feature a lot, so need to patch this somehow. I will keep you up to date on
how I get along. Since this is fixed for newer versions, would anyone know
which classes were modified (the bug report does not provide any information
on this)?

 

Regards,

 

Olli

  _____  

From: Brett Beaumont [mailto:brett.beaumont at sytec.co.nz] 
Sent: 24 August 2004 22:03
To: olli_aro at yahoo.co.uk; The OpenCms mailing list
Subject: RE: [opencms-dev] Fix for bug id 28 for version 5.0.0

 

Olli,

 

We've hit this problem too. I think it is due to doing database imports. We
have no code fix, but we have a set of SQL statements that we have regularly
used to get around this problem.

 

Check whether any property definitions have incorrect IDs by executing the
following SQL:

 

SELECT 
  OFFL.PROPERTYDEF_NAME,
  ONL.PROPERTYDEF_ID ONL_ID,
  OFFL.PROPERTYDEF_ID OFFL_ID
FROM 
  CMS_PROPERTYDEF OFFL,
  CMS_ONLINE_PROPERTYDEF ONL
WHERE 
  OFFL.PROPERTYDEF_NAME = ONL.PROPERTYDEF_NAME AND
  OFFL.RESOURCE_TYPE = ONL.RESOURCE_TYPE  AND
  OFFL.PROPERTYDEF_ID <> ONL.PROPERTYDEF_ID


If any property definitions are listed with different IDs in online and
offline mode, the ID of the online definition must be updated. 


If a definition has <offl_id> as its offline ID and <onl_id> as its online
ID, follow these steps:

 

Check the Online ID is not in use

 

select * from CMS_ONLINE_PROPERTYDEF where PROPERTYDEF_ID = <offl_id>

 

If this returns an empty set, then continue with the next statement.
Otherwise, the existing property with this ID is also incorrect and needs to
be fixed first.

 

Update the Online Property Definition ID 

 

update CMS_ONLINE_PROPERTYDEF set PROPERTYDEF_ID = <offl_id> where
PROPERTYDEF_ID = <onl_id>

 

After each fix, run the top SQL to ensure everything is correct.

 

Commit the changes, if any.

Finally, check that the sequences are not affected:

 

SELECT TABLE_KEY,ID
FROM CMS_SYSTEMID
WHERE TABLE_KEY = 'CMS_PROPERTYDEF' OR TABLE_KEY = 'CMS_ONLINE_PROPERTYDEF'

 

After running the fixes, I always make sure that the IDs in the above table
are at least as high as the highest used ID, which you can get from:

SELECT MAX(PROPERTYDEF_ID) FROM CMS_PROPERTYDEF;    
SELECT MAX(PROPERTYDEF_ID) FROM CMS_ONLINE_PROPERTYDEF;

I believe you need to restart the Tomcat server for the new values in the
System ID table to kick in (I believe it caches these values). However, the
system IDs have usually been okay for me and didn't require updating.
Sometimes you need to republish the content after doing these fixes,
although a restart may fix this.

 

I have found that once you get this problem, it is likely to happen each
time a new property definition is created.

 

Please let me know if this helps, or if you have any questions.

 

Reagrds,

 

Brett Beaumont

 

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]On Behalf Of Olli Aro
Sent: Wednesday, 25 August 2004 5:04 a.m.
To: Opencms-Dev
Subject: [opencms-dev] Fix for bug id 28 for version 5.0.0

Hi all,

 

I am currently implementing a large site based on OpenCMS version 5.0.0 and
have experienced the bug where the property definition ids are out of sync
(http://www.opencms.org/bugzilla/show_bug.cgi?id=28). Could someone advice
me how to patch this for version 5.0.0? All our is developed for version
5.0.0 and we have a lot of content in the cms already so a version upgrade
is not an option:-(

 

Olli

 

 

 

 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.737 / Virus Database: 491 - Release Date: 11/08/2004


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.737 / Virus Database: 491 - Release Date: 11/08/2004



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 24/08/2004


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040825/8a4362c4/attachment.htm>


More information about the opencms-dev mailing list