Skip to content

Commit

Permalink
Merge pull request #18 from open-sausages/pulls/1/fix-filter
Browse files Browse the repository at this point in the history
BUG Don't filter modules by type
  • Loading branch information
robbieaverill authored Mar 25, 2018
2 parents 796fa41 + cb165e1 commit ec27b75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ public function getExposedFolders()
{
$data = $this->getJson();

// Only expose if correct type
if (empty($data['type']) || !preg_match(VendorPlugin::MODULE_FILTER, $data['type'])) {
return [];
}

// Get all dirs to expose
if (empty($data['extra']['expose'])) {
return [];
Expand Down
6 changes: 4 additions & 2 deletions src/VendorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ class VendorPlugin implements PluginInterface, EventSubscriberInterface, Capable
/**
* Default module type
*
* @deprecated 1.3..2.0 Use MODULE_FILTER instead
* @deprecated 1.3..2.0 No longer used
*/
const MODULE_TYPE = 'silverstripe-vendormodule';

/**
* Filter for matching library types to expose
*
* @deprecated 1.3..2.0 No longer used
*/
const MODULE_FILTER = '/^silverstripe\-(\w+)$/';

Expand Down Expand Up @@ -113,7 +115,7 @@ public function getLibrary(PackageEvent $event)
{
// Ensure package is the valid type
$package = $this->getOperationPackage($event);
if (!$package || !preg_match(self::MODULE_FILTER, $package->getType())) {
if (!$package) {
return null;
}

Expand Down

0 comments on commit ec27b75

Please sign in to comment.