diff --git a/code/linkfield/Extensions/CompanyExtension.php b/code/linkfield/Extensions/CompanyExtension.php index b6303b6..18b9e2e 100644 --- a/code/linkfield/Extensions/CompanyExtension.php +++ b/code/linkfield/Extensions/CompanyExtension.php @@ -5,8 +5,6 @@ use SilverStripe\Core\Extension; use SilverStripe\Forms\FieldList; use SilverStripe\LinkField\Models\Link; -use SilverStripe\LinkField\Form\LinkField; -use SilverStripe\LinkField\Form\MultiLinkField; use SilverStripe\LinkField\Models\ExternalLink; class CompanyExtension extends Extension @@ -36,15 +34,6 @@ class CompanyExtension extends Extension protected function updateCMSFields(FieldList $fields) { - $fields->removeByName(['CompanyWebSiteLinkID', 'ManyCompanyWebSiteLinkID']); - - $fields->addFieldsToTab( - 'Root.Main', - [ - LinkField::create('CompanyWebSiteLink', 'Company Website link') - ->setAllowedTypes([ExternalLink::class]), - MultiLinkField::create('ManyCompanyWebSiteLink', 'Multiple Company Website link'), - ] - ); + $fields->dataFieldByName('CompanyWebSiteLink')->setAllowedTypes([ExternalLink::class]); } } diff --git a/code/linkfield/Extensions/ElementContentExtension.php b/code/linkfield/Extensions/ElementContentExtension.php index d7a43a1..350ed45 100644 --- a/code/linkfield/Extensions/ElementContentExtension.php +++ b/code/linkfield/Extensions/ElementContentExtension.php @@ -3,8 +3,6 @@ namespace SilverStripe\FrameworkTest\LinkField\Extensions; use SilverStripe\Core\Extension; -use SilverStripe\LinkField\Form\LinkField; -use SilverStripe\LinkField\Form\MultiLinkField; use SilverStripe\LinkField\Models\Link; use SilverStripe\LinkField\Models\EmailLink; use SilverStripe\LinkField\Models\PhoneLink; @@ -39,18 +37,10 @@ class ElementContentExtension extends Extension protected function updateCMSFields($fields) { - $fields->removeByName(['OneLinkID', 'ManyLinks']); - $fields->addFieldsToTab( - 'Root.Main', - [ - LinkField::create('OneLink', 'Single Link') - ->setAllowedTypes([ - SiteTreeLink::class, - EmailLink::class, - PhoneLink::class - ]), - MultiLinkField::create('ManyLinks', 'Multiple Links'), - ], - ); + $fields->dataFieldByName('OneLink')->setAllowedTypes([ + SiteTreeLink::class, + EmailLink::class, + PhoneLink::class + ]); } } diff --git a/code/linkfield/Extensions/LinkPageExtension.php b/code/linkfield/Extensions/LinkPageExtension.php index 9e9aa98..4cffe03 100644 --- a/code/linkfield/Extensions/LinkPageExtension.php +++ b/code/linkfield/Extensions/LinkPageExtension.php @@ -38,7 +38,7 @@ class LinkPageExtension extends Extension protected function updateCMSFields(FieldList $fields) { - $fields->removeByName(['Content', 'HasOneLinkID', 'HasManyLinksID']); + $fields->removeByName(['Content']); $fields->addFieldsToTab( 'Root.Main',