diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 30971a2..d195d4b 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -449,7 +449,7 @@ function filter_fallback_format_title() { * TRUE if the given text format allows caching, FALSE otherwise. */ function filter_format_allowcache($format_id) { - $format = entity_load('filter_format', $format_id); + $format = $format_id ? entity_load('filter_format', $format_id) : FALSE; return !empty($format->cache); } diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php index 4c36001..7fcc593 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php @@ -118,7 +118,7 @@ function setUp() { function testFormatPermissions() { // Make sure that a regular user only has access to the text formats for // which they were granted access. - $fallback_format = filter_fallback_format(); + $fallback_format = entity_load('filter_format', filter_fallback_format()); $this->assertTrue($this->allowed_format->access('view', $this->web_user), 'A regular user has access to a text format they were granted access to.'); $this->assertFalse($this->disallowed_format->access('view', $this->web_user), 'A regular user does not have access to a text format they were not granted access to.'); $this->assertTrue($fallback_format->access('view', $this->web_user), 'A regular user has access to the fallback format.');