patternlab-php icon indicating copy to clipboard operation
patternlab-php copied to clipboard

Data Override Not Working As Expected

Open frostyweather opened this issue 8 years ago • 1 comments

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.

frostyweather avatar Sep 01 '16 19:09 frostyweather

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.

https://github.com/pattern-lab/patternengine-php-twig/issues/30

magnition-ci avatar Sep 20 '16 10:09 magnition-ci