Hi,
ich entwickle gerade eine Erweiterung für Isotope eCommerce.
Iso Productfeed
Ich bekomme eine Fehlermeldung, wo ich nicht weiterkomme:
The "Bits\IsoProductfeed\Backend\AboutOnloadCallba ck" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
Ich habe jetzt Doku gelesen, im Internet recherchiert und sämtliche Varianten ausprobiert und ja den Cache habe ich auch immer geleert ;-)
Nun bin ich nach 6 Stunden etwas Mürbe und hoffe das mir hier jemand weiterhelfen kann.
Meine services.yaml:
Code:
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters: null
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
Bits\IsoProductfeed\Backend\About:
class: Bits\IsoProductfeed\Backend\AboutOnloadCallback
lazy: false
Bits\IsoProductfeed\Controller\AboutController:
arguments:
$aboutService: '@Bits\IsoProductfeed\Backend\AboutOnloadCallback'
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
Bits\IsoProductfeed\Controller\BackendController:
arguments:
- '@contao.routing.scope_matcher'
tags:
- 'controller.service_arguments'
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Bits\IsoProductfeed\:
resource: ../../../src
exclude:
- ../../../src/{ContaoManager,DependencyInjection,Resources}
# - '../../../src/Backend/ConfigModule.php'
# - '../../../src/Eventlistener/'
Meine Callback-Klasse:
Code:
<?php
namespace Bits\IsoProductfeed\Backend;
use Contao\DataContainer;
use Contao\System;
use Contao\CoreBundle\Framework\ContaoFramework as Framework;
class AboutOnloadCallback
{
private $framework;
public function __construct(Framework $framework)
{
$this->framework = $framework;
}
public function getInfo(DataContainer $dc): void
{
$this->framework->initialize();
// Prüfen, ob der Aufruf im Backend erfolgt
if (System::getContainer()->get('contao.framework')->isBackend()) {
$container = System::getContainer();
// Verfügbarkeit des Services prüfen
if (!$container->has('Bits\IsoProductfeed\Backend\AboutOnloadCallback')) {
throw new \RuntimeException('Service "Bits\IsoProductfeed\Backend\AboutOnloadCallback" is not available.');
}
$aboutService = $container->get('Bits\IsoProductfeed\Backend\AboutOnloadCallback');
$dc->output .= '<div style="margin:10px; padding:10px; background:#f9f9f9; border:1px solid #ccc;">
Die Meta-XML-Datei ist eine Datei, die dabei hilft, Produktdaten zwischen verschiedenen Systemen auszutauschen. Sie sorgt dafür, dass alle wichtigen Informationen zu Ihren Produkten, wie Name, Preis, Verfügbarkeit und Bilder, zentral gespeichert sind und automatisch an andere Plattformen weitergegeben werden können.
Mit der Meta-XML-Datei können Ihre Produkte beispielsweise auf Facebook und Instagram dargestellt werden, ohne dass Sie die Produktdaten doppelt einpflegen müssen. Das spart Zeit, reduziert Fehler und sorgt dafür, dass alle Kanäle stets aktuelle Informationen über Ihre Produkte anzeigen. So bleiben Ihre Angebote überall konsistent und professionell.
</div>';
}
}
}
Hat jemand eine Idee was ich falsch mache?
Achso die Table-Datei vielleicht noch:
Code:
<?php
use Contao\DC_Table;
use Bits\IsoProductfeed\Model\ShopConfig;
use Bits\IsoProductfeed\Model\Attribute;
$GLOBALS['TL_DCA']['tl_iso_productfeed'] = array
(
// Config
'config' => array
(
'dataContainer' => DC_Table::class,
'onload_callback' => array
(
array('Bits\IsoProductfeed\Backend\AboutOnloadCallback', 'getInfo')
...