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

Data Override Not Working As Expected #373

Open

Description

@frostyweather

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.

Activity

  1. magnition-ci commented on Sep 20, 2016

    @magnition-ci

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions