merge stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 02 Sep 2009 09:31:22 +0200
branchstable
changeset 3093 12a69f7f963b
parent 3092 c153b1ae9875 (current diff)
parent 3081 f7e41995a18b (diff)
child 3094 978ed8c2c0e4
child 3098 4f4ad6f50212
merge
--- a/.hgtags	Wed Sep 02 09:30:50 2009 +0200
+++ b/.hgtags	Wed Sep 02 09:31:22 2009 +0200
@@ -60,3 +60,5 @@
 e244a0fd7d719c25f4267470342ff8334b2dc8b3 cubicweb-debian-version-3.4.4-1
 3a65f9b3367c7297dc540a53f84e6507cb309892 cubicweb-version-3.4.5
 7fd294cbf6ff3cf34475cc50e972f650a34ae6e8 cubicweb-debian-version-3.4.5-1
+921fdbf8b3038dc27a2ec5398a0fbcbc5b9ba4be cubicweb-version-3.4.6
+52dba800ca4d4b82c47f3befb824bd91ef015368 cubicweb-debian-version-3.4.6-1
--- a/__pkginfo__.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/__pkginfo__.py	Wed Sep 02 09:31:22 2009 +0200
@@ -7,7 +7,7 @@
 distname = "cubicweb"
 modname = "cubicweb"
 
-numversion = (3, 4, 5)
+numversion = (3, 4, 6)
 version = '.'.join(str(num) for num in numversion)
 
 license = 'LGPL v2'
--- a/cwconfig.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/cwconfig.py	Wed Sep 02 09:31:22 2009 +0200
@@ -134,6 +134,9 @@
     'float' : 'Float',
     }
 
+_forced_mode = os.environ.get('CW_MODE')
+assert _forced_mode in (None, 'system', 'user')
+
 class CubicWebNoAppConfiguration(ConfigurationMixIn):
     """base class for cubicweb configuration without a specific instance directory
     """
@@ -150,7 +153,7 @@
         CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ
         # create __init__ file
         file(join(CUBES_DIR, '__init__.py'), 'w').close()
-    elif exists(join(CW_SOFTWARE_ROOT, '.hg')) or os.environ.get('CW_MODE') == 'user':
+    elif (exists(join(CW_SOFTWARE_ROOT, '.hg')) and _forced_mode != 'system') or _forced_mode == 'user':
         mode = 'dev'
         CUBES_DIR = abspath(normpath(join(CW_SOFTWARE_ROOT, '../cubes')))
     else:
--- a/cwvreg.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/cwvreg.py	Wed Sep 02 09:31:22 2009 +0200
@@ -16,12 +16,18 @@
 
 from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
                       ObjectNotFound, NoSelectableObject, RegistryNotFound,
-                      RegistryOutOfDate, CW_EVENT_MANAGER)
+                      RegistryOutOfDate, CW_EVENT_MANAGER, onevent)
 from cubicweb.utils import dump_class
 from cubicweb.vregistry import VRegistry, Registry
 from cubicweb.rtags import RTAGS
 
 
+@onevent('before-registry-reload')
+def clear_rtag_objects():
+    for rtag in RTAGS:
+        rtag.clear()
+
+
 def use_interfaces(obj):
     """return interfaces used by the given object by searchinf for implements
     selectors, with a bw compat fallback to accepts_interfaces attribute
--- a/debian/changelog	Wed Sep 02 09:30:50 2009 +0200
+++ b/debian/changelog	Wed Sep 02 09:31:22 2009 +0200
@@ -1,3 +1,9 @@
+cubicweb (3.4.6-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Sylvain Thénault <sylvain.thenault@logilab.fr>  Mon, 31 Aug 2009 14:12:30 +0200
+
 cubicweb (3.4.5-1) unstable; urgency=low
 
   * new upstream release
--- a/server/hooks.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/server/hooks.py	Wed Sep 02 09:31:22 2009 +0200
@@ -37,7 +37,7 @@
     # from the database (eg during tests)
     if eschema.eid is None:
         eschema.eid = session.unsafe_execute(
-            'Any X WHERE X is CWEType, X name %(name)s', {'name': etype})[0][0]
+            'Any X WHERE X is CWEType, X name %(name)s', {'name': str(etype)})[0][0]
     return eschema.eid
 
 
--- a/server/session.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/server/session.py	Wed Sep 02 09:31:22 2009 +0200
@@ -129,8 +129,11 @@
                 if row[0] == targeteid:
                     break
             else:
-                raise Exception('cache inconsistency for %s %s %s %s' %
-                                (eid, rtype, role, targeteid))
+                # this may occurs if the cache has been filed by a hook
+                # after the database update
+                self.debug('cache inconsistency for %s %s %s %s', eid, rtype,
+                           role, targeteid)
+                return
             del rset.rows[idx]
             if isinstance(rset.description, list): # else description not set
                 del rset.description[idx]
--- a/sobjects/notification.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/sobjects/notification.py	Wed Sep 02 09:31:22 2009 +0200
@@ -21,7 +21,7 @@
 from cubicweb.server.hookhelper import SendMailOp
 from cubicweb.server.hooksmanager import Hook
 
-parse_message_id = deprecated('parse_message_id is now defined in cubicweb.common.mail')
+parse_message_id = deprecated('parse_message_id is now defined in cubicweb.common.mail')(parse_message_id)
 
 
 class RecipientsFinder(Component):
--- a/web/data/cubicweb.ajax.js	Wed Sep 02 09:30:50 2009 +0200
+++ b/web/data/cubicweb.ajax.js	Wed Sep 02 09:31:22 2009 +0200
@@ -51,7 +51,7 @@
     }
     // find textareas and wrap them if there are some
     if (typeof(FCKeditor) != 'undefined') {
-	buildWysiwygEditors(node);
+	buildWysiwygEditors();
     }
     if (typeof initFacetBoxEvents != 'undefined') {
 	initFacetBoxEvents(node);
@@ -351,7 +351,10 @@
  */
 function buildWysiwygEditors(parent) {
     jQuery('textarea').each(function () {
-	if (this.getAttribute('cubicweb:type', 'wysiwyg')) {
+	if (this.getAttribute('cubicweb:type') == 'wysiwyg') {
+            // mark editor as instanciated, we may be called a number of times
+            // (see postAjaxLoad)
+            this.setAttribute('cubicweb:type', 'fckeditor');
 	    if (typeof FCKeditor != "undefined") {
 		var fck = new FCKeditor(this.id);
 		fck.Config['CustomConfigurationsPath'] = fckconfigpath;
@@ -387,9 +390,10 @@
 /* convenience function that returns a DOM node based on req's result. */
 function getDomFromResponse(response) {
     if (typeof(response) == 'string') {
-	return html2dom(response);
+	var doc = html2dom(response);
+    } else {
+        var doc = response.documentElement;
     }
-    var doc = response.documentElement;
     var children = doc.childNodes;
     if (!children.length) {
 	// no child (error cases) => return the whole document
--- a/web/data/cubicweb.css	Wed Sep 02 09:30:50 2009 +0200
+++ b/web/data/cubicweb.css	Wed Sep 02 09:31:22 2009 +0200
@@ -256,13 +256,17 @@
 }
 
 /* Popup on login box and userActionBox */
+div.popupWrapper{
+ position:relative;
+ z-index:100;
+}
+
 div.popup {
   position: absolute;
-  z-index: 400;
   background: #fff;
   border: 1px solid black;
   text-align: left;
-  float:left;
+  z-index:400;
 }
 
 div.popup ul li a {
@@ -838,4 +842,4 @@
   border: 1px solid #edecd2;
   border-color:#edecd2 #cfceb7 #cfceb7  #edecd2;
   background: #fffff8 url("button.png") bottom left repeat-x;
-}
\ No newline at end of file
+}
--- a/web/uicfg.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/web/uicfg.py	Wed Sep 02 09:31:22 2009 +0200
@@ -67,7 +67,7 @@
 """
 __docformat__ = "restructuredtext en"
 
-from cubicweb import neg_role, onevent
+from cubicweb import neg_role
 from cubicweb.rtags import (RelationTags, RelationTagsBool,
                             RelationTagsSet, RelationTagsDict)
 from cubicweb.web import formwidgets
@@ -216,14 +216,3 @@
 
 actionbox_appearsin_addmenu = RelationTagsBool('actionbox_appearsin_addmenu',
                                                init_actionbox_appearsin_addmenu)
-
-@onevent('before-registry-reload')
-def clear_rtag_objects():
-    primaryview_section.clear()
-    primaryview_display_ctrl.clear()
-    autoform_section.clear()
-    autoform_field.clear()
-    autoform_field_kwargs.clear()
-    autoform_is_inlined.clear()
-    autoform_permissions_overrides.clear()
-    actionbox_appearsin_addmenu.clear()
--- a/web/views/editforms.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/web/views/editforms.py	Wed Sep 02 09:31:22 2009 +0200
@@ -20,7 +20,8 @@
 from cubicweb.utils import make_uid
 from cubicweb.view import EntityView
 from cubicweb.common import tags
-from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs, eid_param, uicfg
+from cubicweb.web import INTERNAL_FIELD_VALUE, RequestError, stdmsgs, eid_param
+from cubicweb.web import uicfg
 from cubicweb.web.form import FormViewMixIn, FieldNotFound
 from cubicweb.web.formfields import guess_field
 from cubicweb.web.formwidgets import Button, SubmitButton, ResetButton
@@ -327,13 +328,13 @@
         """creation view for an entity"""
         etype = kwargs.pop('etype', self.req.form.get('etype'))
         try:
-            entity = self.vreg['etypes'].etype_class(etype)(self.req)
-        except:
-            self.w(self.req._('no such entity type %s') % etype)
-        else:
-            self.initialize_varmaker()
-            entity.eid = self.varmaker.next()
-            self.render_form(entity)
+            etype = self.vreg.case_insensitive_etypes[etype.lower()]
+        except KeyError:
+            raise RequestError(self.req._('no such entity type %s') % etype)
+        entity = self.vreg['etypes'].etype_class(etype)(self.req)
+        self.initialize_varmaker()
+        entity.eid = self.varmaker.next()
+        self.render_form(entity)
 
     def form_title(self, entity):
         """the form view title"""
@@ -371,6 +372,8 @@
     entity
     """
     id = 'copy'
+    warning_message = _('Please note that this is only a shallow copy')
+
     def render_form(self, entity):
         """fetch and render the form"""
         # make a copy of entity to avoid altering the entity in the
@@ -381,7 +384,7 @@
         self.initialize_varmaker()
         self.newentity.eid = self.varmaker.next()
         self.w(u'<script type="text/javascript">updateMessage("%s");</script>\n'
-               % self.req._('Please note that this is only a shallow copy'))
+               % self.req._(self.warning_message))
         super(CopyFormView, self).render_form(self.newentity)
         del self.newentity
 
--- a/web/views/idownloadable.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/web/views/idownloadable.py	Wed Sep 02 09:31:22 2009 +0200
@@ -147,17 +147,17 @@
     def cell_call(self, row, col, width=None, height=None, link=False):
         entity = self.entity(row, col)
         #if entity.data_format.startswith('image/'):
-        imgtag = u'<img src="%s" alt="%s" ' % (xml_escape(entity.download_url()),
-                                               xml_escape(entity.download_file_name()))
+        imgtag = u'<img src="%s" alt="%s" ' % (
+            xml_escape(entity.download_url()),
+            (self.req._('download %s')  % xml_escape(entity.download_file_name())))
         if width:
             imgtag += u'width="%i" ' % width
         if height:
             imgtag += u'height="%i" ' % height
         imgtag += u'/>'
         if link:
-            self.w(u'<a href="%s" alt="%s">%s</a>' % (entity.absolute_url(vid='download'),
-                                                      self.req._('download image'),
-                                                      imgtag))
+            self.w(u'<a href="%s">%s</a>' % (entity.absolute_url(vid='download'),
+                                             imgtag))
         else:
             self.w(imgtag)
 
--- a/web/views/primary.py	Wed Sep 02 09:30:50 2009 +0200
+++ b/web/views/primary.py	Wed Sep 02 09:31:22 2009 +0200
@@ -51,6 +51,7 @@
         boxes = self._prepare_side_boxes(entity)
         if boxes or hasattr(self, 'render_side_related'):
             self.w(u'<table width="100%"><tr><td style="width: 75%">')
+        self.render_entity_summary(entity)
         self.w(u'<div class="mainInfo">')
         self.content_navigation_components('navcontenttop')
         self.render_entity_attributes(entity)
@@ -90,6 +91,8 @@
 
     def render_entity_metadata(self, entity):
         entity.view('metadata', w=self.w)
+
+    def render_entity_summary(self, entity):
         summary = self.summary(entity) # deprecate summary?
         if summary:
             self.w(u'<div class="summary">%s</div>' % summary)