Created
October 23, 2018 22:40
-
-
Save michalkleiner/9c89ff4aebdd024499b586f62ad435b6 to your computer and use it in GitHub Desktop.
Remove File tracking and Link tracking tabs in SS 4.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Name: cwp-fix | |
After: cmslinktracking | |
--- | |
SilverStripe\ORM\DataObject: | |
extensions: | |
- Chrometoaster\Extensions\DataObject\HideFileAndLinkTrackingTabsExtension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Files to create: | |
// app/src/Extensions/DataObject/HideFileAndLinkTrackingTabsExtension.php | |
// app/_config/cwp_fix.yml | |
namespace Chrometoaster\Extensions\DataObject; | |
use SilverStripe\Forms\FieldList; | |
use SilverStripe\ORM\DataExtension; | |
class HideFileAndLinkTrackingTabsExtension extends DataExtension | |
{ | |
/** | |
* Temporarily hide all link and file tracking tabs/fields in the CMS UI | |
* added in SS 4.2 until 4.3 is available | |
* | |
* Related GitHub issues and PRs: | |
* - https://github.com/silverstripe/silverstripe-cms/issues/2227 | |
* - https://github.com/silverstripe/silverstripe-cms/issues/2251 | |
* - https://github.com/silverstripe/silverstripe-assets/pull/163 | |
* | |
* @param FieldList $fields | |
*/ | |
public function updateCMSFields(FieldList $fields) | |
{ | |
$fields->removeByName(['FileTracking', 'LinkTracking']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment