[Mpuls-commits] r5645 - in base/trunk/mpulsweb: controllers model templates/repeatgroup/dialogs

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 23 12:10:50 CET 2011


Author: roland
Date: 2011-11-23 12:10:49 +0100 (Wed, 23 Nov 2011)
New Revision: 5645

Modified:
   base/trunk/mpulsweb/controllers/repeatgroup.py
   base/trunk/mpulsweb/model/case.py
   base/trunk/mpulsweb/templates/repeatgroup/dialogs/confirm_delete_rg_entry.mako
Log:
issue2694: fix problems on dialog for deleting inline RGs

The problem was the use of the model's [gs]etPageId functions, which is not
always populated with the page_id. For this, session['navigation.selectedpage']
should be used instead.


Modified: base/trunk/mpulsweb/controllers/repeatgroup.py
===================================================================
--- base/trunk/mpulsweb/controllers/repeatgroup.py	2011-11-22 14:26:46 UTC (rev 5644)
+++ base/trunk/mpulsweb/controllers/repeatgroup.py	2011-11-23 11:10:49 UTC (rev 5645)
@@ -63,7 +63,7 @@
             c.url_yes = h.url_for(controller='/repeatgroup', action='delete',
                                   id=id, confirmed=1)
             c.url_no = h.url_for(controller='/formularpage', action='select',
-                                 id=session['case'].getPageId())
+                                 id=session['navigation.selectedpage'])
             return render('/repeatgroup/dialogs/confirm_delete_rg_entry.mako')
 
     def new(self, id):

Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2011-11-22 14:26:46 UTC (rev 5644)
+++ base/trunk/mpulsweb/model/case.py	2011-11-23 11:10:49 UTC (rev 5645)
@@ -1181,6 +1181,11 @@
     def getState(self):
         return self.state
 
+    # TODO: the [gs]etPageId functions are deprecated and should be not used, as
+    # it is not assured that page_id will always be populated. For this, use
+    # session['navigation.selectedpage'], which has the same page_id.
+    # This means that this information is saved twice and a better solution
+    # should be found.
     def setPageId(self, id):
         self.page_id = id
 

Modified: base/trunk/mpulsweb/templates/repeatgroup/dialogs/confirm_delete_rg_entry.mako
===================================================================
--- base/trunk/mpulsweb/templates/repeatgroup/dialogs/confirm_delete_rg_entry.mako	2011-11-22 14:26:46 UTC (rev 5644)
+++ base/trunk/mpulsweb/templates/repeatgroup/dialogs/confirm_delete_rg_entry.mako	2011-11-23 11:10:49 UTC (rev 5645)
@@ -6,7 +6,7 @@
 <%def name="buildNavipath()">
 	${parent.buildNavipath()}
         <li><a href="${h.url_for(controller='/case', action='select', id=session.get('case').id, confirmed=1)}">${_('Selected case documents')}</a></li>
-	<li><a href="${h.url_for(controller='/formularpage', action='edit', id=session.get('case').getPageId())}" onclick="return checkModification();">${get_pagename(session.get('case').getPageId())}</a></li>
+	<li><a href="${h.url_for(controller='/formularpage', action='edit', id=session.get('navigation.selectedpage'))}" onclick="return checkModification();">${get_pagename(session.get('navigation.selectedpage'))}</a></li>
 	<li><a href="#">${_('Delete entry')}</a></li>
 </%def>
 <%include file="../../dialogs/confirm.mako" />



More information about the Mpuls-commits mailing list