Hey,
One of my Addon throws an error on theme compile that says:
The „shop“ service is synthetic, it needs to be set at boot time before it can be used.
It apperently has something to do with a Flag.
synthetic=„true“
The Plugin is using the „Shopware()->Shop()“ to get ‚shop‘
A Shopware funktion that is given.
/**
* @return \Shopware\Models\Shop\DetachedShop|null
*/
public function Shop()
{
return $this->container->get('shop');
}
So i replace the call with an inject in to see if it would fix the error.
<argument type="service" id="shop" />
private $oServiceShop;
public function __construct(
.....
Shop $oServiceShop // i also tryed "Shopware\Models\Shop\DetachedShop"
)
{
....
$this->oServiceShop = $oServiceShop;
....
}
public function getShop(){
//Shopware()->Shop();
return $this->oServiceShop;
}
but no luck.
The Problem is really that it gives me nothing about, where the Problem is triggered.
I just know that if i disable the plugin it works and when its on, the error shows on template compile.
Do you guys have any idea on how to like debug this or get clues?
Or maybe you had this Problem before?
Thank you