Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Data Override Not Working As Expected #373

Open
frostyweather opened this issue Sep 1, 2016 · 1 comment
Open

Data Override Not Working As Expected #373

frostyweather opened this issue Sep 1, 2016 · 1 comment
Labels

Comments

@frostyweather
Copy link
Collaborator

I am using Pattern Lab PHP on Mac, using Grunt.

Created a new PL2 Project. Added atoms-/button and molecules-button-list to the project.

atoms/button markup:

<button class="button">

    <span class="button__text">
        {{# buttonText }}
        {{ buttonText }}
        {{/ buttonText }}
    </span>

</button>

I have the molecules/button-list marked up as:

<ul class="button-list">
    {{# buttonList }}
    <li class="button-list__item">{{> atoms-button }}</li>
    {{/ buttonList }}
</ul>

In data.json I have:

  "buttonList" :  [
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {}
  ]  

In my button-test page's JSON button-test.json, I have:

"buttonList" : [
        {
            "buttonText" : "Test1"
        },
        {
            "buttonText" : "Test2"
        }
    ]

Expected Behavior

Removed buttonList altogether from data.json and defined it only in button-test.json to get this:
screen shot 2016-09-01 at 2 57 22 pm

Actual Behavior

Page-based JSON overrides the first 2 items in data.json but prints out the rest of the items from buttonList

screen shot 2016-09-01 at 3 02 37 pm

According to Brad, it seems like a regression bug of some sort.

@bradfrost bradfrost added the bug label Sep 1, 2016
@magnition-ci
Copy link

This might actually also be the same issue I have been experiencing on Mac with the Twig engine. List item data just does not work and I logged the issue in the Twig pattern engine.

pattern-lab/patternengine-php-twig#30

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants