Title: Data inheritance not working · Issue #4 · drupal-pattern-lab/patternengine-php-twig · GitHub
Open Graph Title: Data inheritance not working · Issue #4 · drupal-pattern-lab/patternengine-php-twig
X Title: Data inheritance not working · Issue #4 · drupal-pattern-lab/patternengine-php-twig
Description: I've been trying out the changes from #1 and am struggling to get data inheritance to work. According to @EvanLovely in pattern-lab#36 (comment) this should be working. I'm using a fork of Phase2's pattern lab starter and this is my comp...
Open Graph Description: I've been trying out the changes from #1 and am struggling to get data inheritance to work. According to @EvanLovely in pattern-lab#36 (comment) this should be working. I'm using a fork of Phase2's...
X Description: I've been trying out the changes from #1 and am struggling to get data inheritance to work. According to @EvanLovely in pattern-lab#36 (comment) this should be working. I'm using a fork of ...
Opengraph URL: https://github.com/drupal-pattern-lab/patternengine-php-twig/issues/4
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Data inheritance not working","articleBody":"I've been trying out the changes from https://github.com/drupal-pattern-lab/patternengine-php-twig/pull/1 and am struggling to get data inheritance to work. According to @EvanLovely in https://github.com/pattern-lab/patternengine-php-twig/issues/36#issuecomment-322295048 this should be working.\r\n\r\nI'm using a fork of [Phase2's pattern lab starter](https://github.com/phase2/pattern-lab-starter) and this is my composer.json:\r\n\r\n```\r\n{\r\n \"name\": \"phase2/pattern-lab-starter\",\r\n \"description\": \"Phase2 Pattern Lab for Drupal based on Pattern Lab's Drupal Edition\",\r\n \"keywords\": [\r\n \"pattern lab\",\r\n \"drupal\"\r\n ],\r\n \"homepage\": \"https://github.com/phase2/pattern-lab-starter\",\r\n \"license\": \"GPL-2.0+\",\r\n \"authors\": [\r\n {\r\n \"name\": \"Evan Lovely\",\r\n \"role\": \"Lead Developer\"\r\n }\r\n ],\r\n \"support\": {\r\n \"issues\": \"https://github.com/phase2/pattern-lab-starter/issues\"\r\n },\r\n \"autoload\": {\r\n \"psr-0\": {\r\n \"PatternLab\": \"core/src/\"\r\n }\r\n },\r\n \"repositories\": [\r\n {\r\n \"type\": \"vcs\",\r\n \"url\": \"https://github.com/drupal-pattern-lab/patternlab-php-core.git\"\r\n }\r\n ],\r\n \"require\": {\r\n \"php\": \">=5.5.9\",\r\n \"pattern-lab/core\": \"^2.8.0\",\r\n \"pattern-lab/patternengine-twig\": \"^2.0.0\",\r\n \"pattern-lab/styleguidekit-twig-default\": \"^3.0.0\",\r\n \"pattern-lab/drupal-twig-components\": \"^2.0.0\",\r\n \"pattern-lab/plugin-faker\": \"^2.0\",\r\n \"evanlovely/plugin-twig-namespaces\": \"^1.0\",\r\n \"aleksip/plugin-data-transform\": \"^1.1\"\r\n },\r\n \"scripts\": {\r\n \"post-install-cmd\": [\r\n \"PatternLab\\\\Installer::postInstallCmd\"\r\n ],\r\n \"post-update-cmd\": [\r\n \"PatternLab\\\\Installer::postUpdateCmd\"\r\n ],\r\n \"post-root-package-install\": [\r\n \"PatternLab\\\\Installer::setProjectInstall\",\r\n \"PatternLab\\\\Installer::getSuggestedStarterKits\",\r\n \"PatternLab\\\\Installer::getConfigOverrides\"\r\n ],\r\n \"post-package-install\": [\r\n \"PatternLab\\\\Installer::postPackageInstall\"\r\n ],\r\n \"post-package-update\": [\r\n \"PatternLab\\\\Installer::postPackageUpdate\"\r\n ],\r\n \"pre-package-uninstall\": [\r\n \"PatternLab\\\\Installer::prePackageUninstall\"\r\n ]\r\n },\r\n \"extra\": {\r\n \"patternlab\": {\r\n }\r\n }\r\n}\r\n```\r\n\r\nIt might be entirely possible that I need to install other forked repos but its not clear to me what I need.\r\n\r\nMy understanding is that `aleksip/plugin-data-transform` should provide the data inheritance.\r\n\r\nMy simple test scenario is:\r\n\r\nParent template:\r\n```\r\n\u003cdiv class=\"paragraph-text-only__text-long\">\r\n {% include \"@atoms/fields/text-long/text-long.twig\" %}\r\n\u003c/div>\r\n```\r\n\r\nIncluded template (text-long.twig):\r\n```\r\n{{ content }}\r\n```\r\n\r\nThe included template also has some associated data in `text-long.json`:\r\n```\r\n{\r\n \"content\": \"Some test content\"\r\n}\r\n```\r\n\r\nWhen I view the parent template I see errors:\r\n```\r\nNotice: Array to string conversion in /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Environment.php(462) : eval()'d code on line 19 Call Stack: 0.0002 263464 1. {main}() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/core/console:0 0.0393 4339136 2. PatternLab\\Console::run() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/core/console:46 0.0416 4572504 3. PatternLab\\Console\\Commands\\GenerateCommand->run() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/pattern-lab/core/src/PatternLab/Console.php:91 0.0588 6514696 4. PatternLab\\Generator->generate() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/pattern-lab/core/src/PatternLab/Console/Commands/GenerateCommand.php:42 0.0749 6888824 5. PatternLab\\PatternData::gather() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/pattern-lab/core/src/PatternLab/Generator.php:69 0.1822 10144408 6. PatternLab\\PatternData\\Helpers\\PatternCodeHelper->run() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/pattern-lab/core/src/PatternLab/PatternData.php:209 3.0459 41953616 7. PatternLab\\PatternEngine\\Twig\\Loaders\\PatternLoader->render() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/pattern-lab/core/src/PatternLab/PatternData/Helpers/PatternCodeHelper.php:89 3.0459 41953616 8. Twig_Environment->render() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/pattern-lab/patternengine-twig/src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php:119 3.1064 43015848 9. Twig_Template->render() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Environment.php:362 3.1064 43032560 10. Twig_Template->display() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Template.php:411 3.1064 43033024 11. Twig_Template->displayWithErrorHandling() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Template.php:403 3.1064 43033096 12. __TwigTemplate_ffe61fee2246b15f94ee22ff8815e151d63c4190ab0da22d17d478f808ff4e6d->doDisplay() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Template.php:432 3.1072 43875792 13. Twig_Template->display() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Environment.php(462) : eval()'d code:33 3.1072 43876064 14. Twig_Template->displayWithErrorHandling() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Template.php:403 3.1072 43876064 15. __TwigTemplate_3275ef305a7d7efaddc7a0078b511bbf2e63fb899408c45405c3479f2c187593->doDisplay() /Users/tanc/Sites/l.install_profile/gitroot/web/themes/custom/site_theme/pattern-lab/vendor/twig/twig/lib/Twig/Template.php:432 Array\r\n```\r\n\r\nIs there anything I'm missing? Any advice on where to start looking?","author":{"url":"https://github.com/tanc","@type":"Person","name":"tanc"},"datePublished":"2017-08-15T08:56:23Z","url":"https://github.com/drupal-pattern-lab/patternengine-php-twig/issues/4"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:78889657-5080-6b0f-d872-6b67865733e2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C83C:83E6C:399E60:4E207C:6AFBB6BF |
| html-safe-nonce | bab8128cc975f16482c8e87e151a4691a9e5688c745ba6439c384025d3225c41 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODNDOjgzRTZDOjM5OUU2MDo0RTIwN0M6NkFGQkI2QkYiLCJ2aXNpdG9yX2lkIjoiNjQ5MzU5NDQ0OTk4ODAwNzYxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 68f10a8c7836edd9202f20768a529e08d467a120aca96d2e0ccbfd5a5a4bdf14 |
| hovercard-subject-tag | issue:250258746 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/drupal-pattern-lab/patternengine-php-twig/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ca8ff0a3d45530ca26fbc08a7c133eb816e4703fc8e75761c282d7251928532a/drupal-pattern-lab/patternengine-php-twig/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ca8ff0a3d45530ca26fbc08a7c133eb816e4703fc8e75761c282d7251928532a/drupal-pattern-lab/patternengine-php-twig/issues/4 |
| og:image:alt | I've been trying out the changes from #1 and am struggling to get data inheritance to work. According to @EvanLovely in pattern-lab#36 (comment) this should be working. I'm using a fork of Phase2's... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tanc |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/drupal-pattern-lab/patternengine-php-twig git https://github.com/drupal-pattern-lab/patternengine-php-twig.git |
| octolytics-dimension-user_id | 28110146 |
| octolytics-dimension-user_login | drupal-pattern-lab |
| octolytics-dimension-repository_id | 89639036 |
| octolytics-dimension-repository_nwo | drupal-pattern-lab/patternengine-php-twig |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 21108033 |
| octolytics-dimension-repository_parent_nwo | pattern-lab/patternengine-php-twig |
| octolytics-dimension-repository_network_root_id | 21108033 |
| octolytics-dimension-repository_network_root_nwo | pattern-lab/patternengine-php-twig |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width