#5286 neighborhood_blog_posts macro should ignore bad markup

v1.0.0
closed
sf-1 (616)
General
Cory Johns
2015-08-20
2012-11-13
Rich Bowen
No

The neighborhood_blog_posts macro, eg on https://sourceforge.net/p/test-wiki/All%20project%20news/ , should ignore blog posts that contain bad markup, or perhaps just provide a link to the post, rather than having the entire macro fail.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-11-13

    Problem is tools that no longer exist:

      File "/var/local/allura/Allura/allura/lib/macro.py", line 112, in neighborhood_blog_posts
        for post in posts if security.has_access(post, 'read', project=post.app.project)() and
      File "/var/local/allura/Allura/allura/lib/macro.py", line 112, in <genexpr>
        for post in posts if security.has_access(post, 'read', project=post.app.project)() and
      File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.3.2dev_20121101-py2.7.egg/ming/utils.py", line 18, in __get__
        result = obj.__dict__[self.__name__] = self._func(obj)
      File "/var/local/allura/Allura/allura/model/artifact.py", line 189, in app
        if getattr(c, 'app', None) and c.app.config._id == self.app_config._id:
    AttributeError: 'NoneType' object has no attribute '_id'
    
     
  • Dave Brondsema

    Dave Brondsema - 2012-11-13
    • milestone: limbo --> forge-nov-30
     
  • Dave Brondsema

    Dave Brondsema - 2012-11-16
    • size: --> 1
     
  • Tim Van Steenburgh

    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
     
  • Tim Van Steenburgh

    forge:tv/5286

    On master you can repro the error by installing a Blog tool, publishing a post, deleting the config for the blog tool document from mongo, then using the neighborhood_blog_posts macro.

    The new code will just skip orphaned posts instead of causing an error.

     
  • Tim Van Steenburgh

    • status: in-progress --> code-review
    • qa: Cory Johns
     
  • Dave Brondsema

    Dave Brondsema - 2012-11-30
    • Milestone: forge-nov-30 --> forge-dec-14
     
  • Cory Johns

    Cory Johns - 2012-12-03
    • status: code-review --> closed
     

Log in to post a comment.