Description

action=PackagePages fails because

Config instance has no attribute 'allowed_actions'

    * args = ("Config instance has no attribute 'allowed_actions'",)

while debugging I found some more problems. To get this routine principle working look at the patch. I file an other bug report dependend on this changes regarding PageEditor. I am very interested in this routine so I like to help with it if you are interested -- ReimarBauer 2005-11-01 14:07:27

Steps to reproduce

http://moinmoin.wikiwikiweb.de/ParserMarket/Gallery2?action=PackagePages

Details

This Wiki

Workaround

imply this patch

--- PackagePages.py     2005-11-01 12:34:16.000000000 +0100
+++ PackagePages.py.rb  2005-11-01 15:04:43.000000000 +0100
@@ -30,8 +30,7 @@
     def allowed(self):
         """ Check if user is allowed to do this. """
         may = self.request.user.may
-        return (self.__class__.__name__ in self.request.cfg.allowed_actions and
-                may.write(self.pagename))
+        return  may.write(self.pagename)
     
     def render(self):
         """ Render action
@@ -70,7 +69,7 @@
             raise ActionError(self.makeform())
 
         pages = []
-        for pagename in unpackLine(pagelist, ","):
+        for pagename in pagelist.split(","):  # RB I think split is right here
             pagename = self.request.normalizePagename(pagename)
             if pagename:
                 page = Page(self.request, pagename)
@@ -88,7 +87,8 @@
         # get directory, and possibly create it
         attach_dir = Page(self.request, self.page.page_name).getPagePath("attachments", check_create=1)
         fpath = os.path.join(attach_dir, target).encode(config.charset)
-        print fpath
+        #print fpath
+        
         if os.path.exists(fpath):
             raise ActionError(_("Attachment '%(target)s' (remote name '%(filename)s') already exists.") % {
                 'target': wikiutil.escape(target), 'filename': wikiutil.escape(target)})
@@ -116,6 +116,7 @@
 
         _addLogEntry(self.request, 'ATTNEW', pagename, target)
         
+        
         raise ActionError(_("Created the package %s containing the pages %s.") % (wikiutil.escape(target), wikiutil.escape(pagelist)))
 
     def makeform(self, error=""):
@@ -131,7 +132,7 @@
         d = {
             'error': error,
             'action': self.__class__.__name__,
-            'pagename': wikiutil.escape(self.pagename),
+            'pagename': wikiutil.escape(self.pagename), 
             'package': _('Package pages'),
             'cancel': _('Cancel'),
             'newname_label': _("Package name"),
@@ -151,7 +152,7 @@
     <tr>
         <td class="label"><label>%(list_label)s</label></td>
         <td class="content">
-            <input type="text" name="pagelist" maxlength="80">
+            <input type="text" name="pagelist" maxlength="80" value="%(pagename)s">  
         </td>
     </tr>
     <tr>
@@ -169,3 +170,5 @@
 def execute(pagename, request):
     """ Glue code for actions """
     PackagePages(pagename, request).render()
+    
+    

Discussion

See patch

Should this routine in this stage package attachments too?

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/PackagePagesFailsBecauseAllowedActionsMissing (last edited 2007-10-29 19:06:23 by localhost)