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

Issue with Bamboo Twig #334

Open
sinyayadynya opened this issue Apr 19, 2019 · 1 comment
Open

Issue with Bamboo Twig #334

sinyayadynya opened this issue Apr 19, 2019 · 1 comment

Comments

@sinyayadynya
Copy link

Hi,
I want to use Bamboo Twig (https://www.drupal.org/project/bamboo_twig), but after creating the following 'components/_twig-components/functions/pl_bamboo_load_currentuser.function.php' file with:

<?php
/**
 * @file
 * Add "bamboo_load_currentuser" function for Pattern Lab.
 */

$function = new Twig_SimpleFunction('bamboo_load_currentuser', function ($string) {
  return $string;
});

I'm getting the following error while doing 'yarn start':

PHP Warning:  Invalid argument supplied for foreach() in ../web/themes/custom/rw/components/_twig-components/functions/add_attributes.function.php on line 61
PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function PatternLab\PatternEngine\Twig\TwigUtil::{closure}(), 0 passed in ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Environment.php(497) : eval()'d code on line 101 and exactly 1 expected in ../web/themes/custom/rw/components/_twig-components/functions/pl_bamboo_load_currentuser.function.php:7
Stack trace:
#0 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Environment.php(497) : eval()'d code(101): PatternLab\PatternEngine\Twig\TwigUtil::{closure}()
#1 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Template.php(427): __TwigTemplate_cbf5d6a87d361cc7730e5eae5d8b6b1c7e920bb86d13afa1de36a8a43dcc5a8a->doDisplay(Array, Array)
#2 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Template.php(398): Twig\Template->displayWithErrorHandling(Array, Array)
#3 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src in ../web/themes/custom/rw/components/_twig-components/functions/pl_bamboo_load_currentuser.function.php on line 7

Fatal error: Uncaught ArgumentCountError: Too few arguments to function PatternLab\PatternEngine\Twig\TwigUtil::{closure}(), 0 passed in ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Environment.php(497) : eval()'d code on line 101 and exactly 1 expected in ../web/themes/custom/rw/components/_twig-components/functions/pl_bamboo_load_currentuser.function.php:7
Stack trace:
#0 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Environment.php(497) : eval()'d code(101): PatternLab\PatternEngine\Twig\TwigUtil::{closure}()
#1 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Template.php(427): __TwigTemplate_cbf5d6a87d361cc7730e5eae5d8b6b1c7e920bb86d13afa1de36a8a43dcc5a8a->doDisplay(Array, Array)
#2 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src/Template.php(398): Twig\Template->displayWithErrorHandling(Array, Array)
#3 ../web/themes/custom/rw/pattern-lab/vendor/twig/twig/src in ../web/themes/custom/rw/components/_twig-components/functions/pl_bamboo_load_currentuser.function.php on line 7
Error with code 255 after running: php pattern-lab/core/console --generate

Any idea how to solve it?

Thanks for help.

@sinyayadynya
Copy link
Author

PS: for that project, I'm on Emulsify 2.7

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

1 participant