From 6455348f89e078a90795124b44ee5522edfcaa29 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sun, 19 Apr 2009 20:50:20 +0000
Subject: [PATCH] It was inconsistent to call getProperty then getReference
 (hasReference then getReference is also consistent). Added title_or_id method
 as alias to getTitleOrId, just for CMF compatibility.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26502 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index b3bcba78e1..3df0448c52 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -398,7 +398,7 @@ class PropertyHolder:
       by postponing security declaration.
 
       WARNING: we optimize size by not setting security if 
-      it is the same as the default. This may be  a bit
+      it is the same as the default. This may be a bit
       dangerous if classes use another default
       security.
     """
@@ -2409,10 +2409,15 @@ class Base( CopyContainer,
   security.declareProtected( Permissions.View, 'Title' )
   Title = getTitleOrId
 
+  # CMF Compatibility
+  security.declareProtected( Permissions.View, 'title_or_id' )
+  title_or_id = getTitleOrId
+
   security.declareProtected(Permissions.AccessContentsInformation,
                             'getTitleAndId')
   def getTitleAndId(self):
-    """Returns the title and the id in parenthesis
+    """
+      Returns the title and the id in parenthesis
     """
     return self.title_and_id()
 
@@ -2524,7 +2529,7 @@ class Base( CopyContainer,
       r = self.getShortTitle()
       if r: return r
     if self.getProperty('reference'):
-      r = self.getReference()
+      r = self.getProperty('reference') 
       if r: return r
     r = self._baseGetTitle() # No need to test existence since all Base instances have this method
     if r: return r      # Also useful whenever title is calculated
-- 
2.30.9