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

Alexander Kandzior alex at opencms.org
Thu Aug 26 09:16:59 CEST 2004


Olli,

As far as I remember the issue with the property definition was like this:
 
As far as you only create new property definitions you are fine. Trouble
starts when you delete property definitions with the Admin screen in the
backoffice. In this case the IDs for property definitions in the online and
offline project are out of sync for all property definitions that are
created afterwards. If I remember correctly, the bug was caused because
somewhere the property definitions are alwayss read from the online project,
which gives wrong IDs in the offline project when the IDs are out of sync.
The issue was fixed in 5.0.1 so you can compare the DB classes
(CmsResourceBroker) and check for code dealing with property definitions.
 
You should be able to avoid the issue if you just don't make use of the
Admin backoffice for properties (or at last don't delete any property
definitions).

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com <http://www.alkacon.com/> 



 


________________________________

	From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Brett Beaumont
	Sent: Wednesday, August 25, 2004 11:14 PM
	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,
	 
	The problem only seems to occur if you create new property
definitions. If your module defines new definitions often, then you'll
likely see this problem again. However, if you are just adding properties
that are already defined, you should be okay.
	 
	If you do find a fix out there, please let me know. Our templates
have mostly stabilised, so we don't hit this too much any more, but we have
hit it dozens of times when we were moving things to and from
dev/UAT/production.
	 
	Brett

		-----Original Message-----
		From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]On Behalf Of Olli Aro
		Sent: Thursday, 26 August 2004 4:45 a.m.
		To: 'The OpenCms mailing list'
		Subject: RE: [opencms-dev] Fix for bug id 28 for version
5.0.0
		
		

		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 optionL

			 

			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
		





More information about the opencms-dev mailing list