silverstripe-cms/code/Controllers
maks 599e198e89
simplify code using !empty
Hello @robbieaverill, please check my assumption...it's been a long time since I have last used SS (v3.2 was my last, if i remember correctly)
in the following lines 438:
```php
        if (isset($this->templates[$action]) && $this->templates[$action]
            || (isset($this->templates['index']) && $this->templates['index'])
            || $this->template
        ) {
            return parent::getViewer($action);
        }
```
it looks like the 1st two (same-line) condition should be wrapped inside `()` while checking for a non-index action template .... if not just kill this PR at once. :-)
if the answer is yes then we can just use `!empty(...)` which is the same as 'isset(...) + truthy check'

kind regards, 
maks
2018-08-17 14:51:36 +02:00
..
CMSMain.php Merge remote-tracking branch 'origin/4.0' into 4.1 2018-04-13 10:03:47 +12:00
CMSPageAddController.php Update usages of ClassInfo 2017-09-20 15:20:17 +12:00
CMSPageEditController.php API Implement insert-anchor modal 2017-09-20 13:35:25 +12:00
CMSPageHistoryController.php Merge pull request #2099 from creative-commoners/pulls/4.0/dont-alias-this 2018-02-15 10:01:52 +00:00
CMSPagesController.php NEW Add extension point to CMSMain::Breadcrumbs 2018-02-20 14:28:25 +13:00
CMSPageSettingsController.php BUG Fix inconsistent breadcrumbs in CMS section 2017-08-28 13:03:56 +12:00
CMSSiteTreeFilter_ChangedPages.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter_DeletedPages.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter_PublishedPages.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter_Search.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter_StatusDeletedPages.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter_StatusDraftPages.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter_StatusRemovedFromDraftPages.php MINOR Simplify i18n keys 2018-02-21 10:32:13 +13:00
CMSSiteTreeFilter.php Update CMS for versioned enhancements (#2122) 2018-03-14 16:34:46 +13:00
ContentController.php simplify code using !empty 2018-08-17 14:51:36 +02:00
LeftAndMainPageIconsExtension.php Issue-2034: Fix for Page icons using data urls 2017-11-23 15:42:31 +00:00
ModelAsController.php Update usages of ClassInfo 2017-09-20 15:20:17 +12:00
OldPageRedirector.php Update CMS for versioned enhancements (#2122) 2018-03-14 16:34:46 +13:00
RootURLController.php App object refactor 2017-06-20 17:12:18 +12:00
SilverStripeNavigator.php Update usages of ClassInfo 2017-09-20 15:20:17 +12:00
SilverStripeNavigatorItem_ArchiveLink.php BUG Fix behaviour towards versioned but unstagable records 2018-02-20 11:03:23 +13:00
SilverStripeNavigatorItem_CMSLink.php Ran upgrader for lang files 2017-04-27 11:43:04 +12:00
SilverStripeNavigatorItem_LiveLink.php BUG Fix behaviour towards versioned but unstagable records 2018-02-20 11:03:23 +13:00
SilverStripeNavigatorItem_StageLink.php BUG Fix behaviour towards versioned but unstagable records 2018-02-20 11:03:23 +13:00
SilverStripeNavigatorItem.php BUG Fix behaviour towards versioned but unstagable records 2018-02-20 11:03:23 +13:00