Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Jan 11, 2024 · 2 comments

Comments

@minchaminder
Copy link

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
Copy link

gabo34 commented Feb 27, 2024

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
Copy link

gabo34 commented Feb 27, 2024

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants