Skip to content

Commit

Permalink
Merge branch 'master' into issue_686
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Dec 12, 2016
2 parents 11590e9 + 68524e2 commit 84a6411
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -9,6 +9,9 @@ There's a frood who really knows where his towel is.
- Fix ``TypeError`` when changing default image scale on basic tiles (fixes `#686`_).
[rodfersou]

- Fix ``@@updatetilecontent`` view to avoid rendering outdated data.
[hvelarde]

- Fixed adding a 'more' link in list tiles.
Previously you could select an item to use as 'more' link,
but it did not stick. [maurits]
Expand Down
6 changes: 6 additions & 0 deletions src/collective/cover/browser/compose.py
Expand Up @@ -50,10 +50,16 @@ def render(self):
path = '{0}/{1}'.format(self.tile_type, self.tile_id)
tile = self.context.restrictedTraverse(path)
tile.populate_with_object(obj)
# reinstantiate tile to update rendering with new data
tile = self.context.restrictedTraverse(path)
return tile()

def __call__(self):
self.setup()
# avoid caching the response on intermediate proxies
# as this is a GET request, a misconfiguration could
# result on outdated content being rendered
self.request.response.setHeader('Cache-Control', 'no-cache')
return self.render()


Expand Down
4 changes: 4 additions & 0 deletions src/collective/cover/tiles/basic.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from collective.cover import _
from collective.cover.interfaces import ISearchableText
from collective.cover.logger import logger
from collective.cover.tiles.base import IPersistentCoverTile
from collective.cover.tiles.base import PersistentCoverTile
from collective.cover.tiles.configuration_view import IDefaultConfigureForm
Expand Down Expand Up @@ -119,6 +120,9 @@ def populate_with_object(self, obj):
data_mgr = ITileDataManager(self)
data_mgr.set(data)

msg = 'tile "{0}"" populated with data: {1}'
logger.debug(msg.format(self.id, data))

@property
def alt(self):
"""Return the alt attribute for the image."""
Expand Down

0 comments on commit 84a6411

Please sign in to comment.