Merge pull request #168 from creative-commoners/pulls/1/linkblock

Ensure both linkfield and elemental exist before applying extension
This commit is contained in:
Guy Sartorelli 2024-03-04 11:28:14 +13:00 committed by GitHub
commit b4355b0c5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -48,15 +48,21 @@ BasicElementalPage:
Only:
moduleexists: 'silverstripe/linkfield'
---
SilverStripe\FrameworkTest\LinkField\PageTypes\LinkFieldTestPage:
extensions:
- SilverStripe\FrameworkTest\LinkField\Extensions\LinkPageExtension
SilverStripe\FrameworkTest\Model\Company:
extensions:
extensions:
- SilverStripe\FrameworkTest\LinkField\Extensions\CompanyExtension
---
Only:
moduleexists:
- 'silverstripe/linkfield'
- 'dnadesign/silverstripe-elemental'
---
SilverStripe\FrameworkTest\LinkField\Blocks\LinkFieldTestBlock:
extensions:
- SilverStripe\FrameworkTest\LinkField\Extensions\ElementContentExtension

View File

@ -4,6 +4,10 @@ namespace SilverStripe\FrameworkTest\LinkField\Blocks;
use DNADesign\Elemental\Models\BaseElement;
if (!class_exists(BaseElement::class)) {
return;
}
class LinkFieldTestBlock extends BaseElement
{
private static string $table_name = 'LinkFieldTestBlock';