Logicify / mautic-advanced-templates-bundle

Plugin extends default email template capabilities with TWIG block so you can use advanced scripting techniques like conditions, loops etc
https://logicify.com/?utm_source=github&utm_campaign=mautic-templates&utm_medium=opensource
MIT License
86 stars 57 forks source link

Cannot autowire service "MauticPlugin\MauticAdvancedTemplatesBundle\Feed\Feed": argument "$feed" of method "__construct()" has no type-hint, you should configure its value explicitly. #38

Open minchaminder opened 7 months ago

minchaminder commented 7 months ago

Getting this when trying to clear cache after uploading plugin files (Mautic 5.0.1)

In DefinitionErrorExceptionPass.php line 54:

Cannot autowire service "MauticPlugin\MauticAdvancedTemplatesBundle\Feed\Feed": argument "$feed" of method "__construct()" has no type-hint, you should configure its value explicitly.

gabo34 commented 6 months ago

php bin/console -V Mautic 5.0.3 - app/prod (env: prod, debug: false)

php -v PHP 8.1.27 (cli) (built: Jan 24 2024 00:32:48) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.27, Copyright (c) Zend Technologies

vi plugins/MauticAdvancedTemplatesBundle/Feed/Feed.php /* @var string / private $feed;

/** @var \SimpleXMLElement  */
private $rss;

public function __construct($feed)

{ $this->feed = $feed; $this->rss = simplexml_load_file($feed); }

maybe can work with private $feed="";

gabo34 commented 6 months ago

i destroyed constructor, vi plugins/MauticAdvancedTemplatesBundle/Feed/Feed.php so i can do php bin/console cache:clear

public function __construct()

{

$this->feed = $feed;

    #$this->rss = simplexml_load_file($feed);

}