3.1: Fix `{{ layout }}` oddities (proper inheritance & fixing overflow of old data) #4909

Merged
merged 3 commits into from May 18, 2016

Conversation

Projects
None yet
2 participants
@parkr
Member

parkr commented May 18, 2016

This pull request fixes two bugs:

  1. #4433, which describes a bug where if you have a variable in a layout "special" that inherits from "default," you will see the data value from "default" instead of "special." The inheritance should mean that more specific layouts' data override the less specific layouts' data.
  2. #4897, which describes a bug where the rendering of a page means its {{ layout }} variables exist for pages rendered later without the same data hierarchy (they "overflow" from one page to the next without being specified by the subsequent page)

This is slated for v3.1.4. 馃槃

parkr added some commits May 18, 2016

@parkr parkr added the fix label May 18, 2016

@parkr parkr added this to the 3.1.4 milestone May 18, 2016

while layout
payload['content'] = output
payload['page'] = document.to_liquid
- payload['layout'] = Utils.deep_merge_hashes(payload['layout'] || {}, layout.data)
+ payload['layout'] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})

This comment has been minimized.

@parkr

parkr May 18, 2016

Member

@benbalter This is a breaking change that is considered a bug fix (it was a bug that the default layout, for example, overwrote the metadata from a more specific/child layout like "page" or "post). How can I best communicate this change?

@parkr

parkr May 18, 2016

Member

@benbalter This is a breaking change that is considered a bug fix (it was a bug that the default layout, for example, overwrote the metadata from a more specific/child layout like "page" or "post). How can I best communicate this change?

This comment has been minimized.

@benbalter

benbalter May 18, 2016

Contributor

Chatted offline, but just to memorialize here:

  1. Changelog
  2. Jekyll blog post upon release
  3. GitHub blog post upon upgrade
@benbalter

benbalter May 18, 2016

Contributor

Chatted offline, but just to memorialize here:

  1. Changelog
  2. Jekyll blog post upon release
  3. GitHub blog post upon upgrade

@parkr parkr merged commit 21c563c into 3.1-stable May 18, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@parkr parkr deleted the 3.1-fix-layout-var-overflow branch May 18, 2016

parkr added a commit that referenced this pull request May 18, 2016

@parkr parkr referenced this pull request May 18, 2016

Closed

Port changes in v3.1.4 & v3.1.5 & v3.1.6 forward #4911

8 of 8 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment