use SilverStripe\ORM\DataExtension;
use SilverStripe\ORM\DataObject;
use SilverStripe\CMS\Model\SiteTree;
use gorriecoe\Link\Models\Link;
use gorriecoe\LinkField\LinkField;
class CustomSiteConfig extends DataExtension
{
private static $has_one = [
'LinkShop' => Link::class
];
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldsToTab(
'Root.Main',
[
LinkField::create(
'LinkShop',
'LinkShop',
$this
)
]
);
}
}
I get the following Error in log and the settings page shows error.
[2019-02-28 11:43:13] error-log.ERROR: Uncaught Exception Error: "Call to undefined method CustomSiteConfig::exists()" at /var/www/domain/vendor/gorriecoe/silverstripe-linkfield/src/LinkField.php line 151 {"exception":"[object] (Error(code: 0): Call to undefined method CustomSiteConfig::exists() at /var/www/domain/vendor/gorriecoe/silverstripe-linkfield/src/LinkField.php:151)"} []
I tried to extend the SiteConfig with a linkable field.
https://docs.silverstripe.org/en/4/developer_guides/configuration/siteconfig/#extending-siteconfig
}
I get the following Error in log and the settings page shows error.