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

Pattern generation fails with an error #15

Open
davidcmoulton opened this issue Jul 19, 2018 · 5 comments
Open

Pattern generation fails with an error #15

davidcmoulton opened this issue Jul 19, 2018 · 5 comments

Comments

@davidcmoulton
Copy link

Generating the patterns using this starter kit gives the following error (file paths have been sanitised)):

Fatal error: Uncaught Error: Call to undefined method __TwigTemplate_cb87d917ee046806b780332adb3b678cc4ebc7d51303b5fbaa0bca108638e7a0::getinput() in [...]/pattern-library/vendor/twig/twig/lib/Twig/Environment.php(467) : eval()'d code:50
Stack trace:
#0 [...]/pattern-library/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_e3395681ed42013d40ffe03f163864d1d9e831fe1c0e01f210d6af0cd93d309d->doDisplay(Array, Array)
#1 [...]/pattern-library/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#2 [...]/pattern-library/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#3 [...]/pattern-library/vendor/twig/twig/lib/Twig/Environment.php(363): Twig_Template->render(Array)
#4 [...]/pattern-library/vendor/pattern-lab/patternengine-twig/src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php(120): Twig_En in [...]/pattern-library/vendor/twig/twig/lib/Twig/Environment.php(467) : eval()'d code on line 50

Steps to reproduce:

Prerequisite: install PHP Pattern Lab Twig and verify it works with the base starter kit

  1. install Pattern Lab edition-php-twig-standard via recommended composer command (composer create-project pattern-lab/edition-twig-standard pattern-library && cd $_)
  2. during the installation process choose to install starterkit-twig-base. (Note we're not choosing starterkit-twig-demo because of the advice not to install this via Composer.)
  3. once installation has finished, run php core/console --generate. This runs fine.

Demonstrate the error

  1. install starterkit-twig-demo (don't use Composer): php core/console --starterkit --install pattern-lab/starterkit-twig-demo.
  2. once installation has finished, run php core/console --generate. This causes the error.

This looks like a bug to me, but I realise I might be missing something.

@andyxmas
Copy link

Same issue here. @davidcmoulton did you find a workaround?

@ladyhunterbear
Copy link

Workaround:

  1. Delete patterns/00-atoms/05-forms/00-text-fields.twig - there appears to be an issue with the import.
  2. Edit patterns/03-templates/03-article-2col.twig, first line should read
    {% extends "@templates/00-layouts/page-2col.twig" %} not {% extends "@templates/page-2col.twig" %}

@davidcmoulton
Copy link
Author

Confirming this works for me. Thanks @ladyhunterbear.

@jirmueller
Copy link

Based on what @ladyhunterbear said I'd like to add my findings:

  1. you don't have to delete that file (00-text-fields.twig)! Just have a closer look into the config.yml and change the line twigMacroExt: macro.twig to twigMacroExt: macro.php

This way php should be able to render the referenced macros.

@heitoralthmann
Copy link
Contributor

@jirmueller Unfortunately changing twigMacroExt to macro.php doesn't work for me. I will keep on searching and updating the thread with my fiends. Thank you!

heitoralthmann added a commit to heitoralthmann/starterkit-twig-demo that referenced this issue Nov 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants