Commit abfc190c authored by catch's avatar catch

Issue #2253735 by larowlan, olli, xjm: Fixed WSOD on custom block creation /...

Issue #2253735 by larowlan, olli, xjm: Fixed WSOD on custom block creation / listing if config translation enabled.
parent 949e7fe6
......@@ -21,7 +21,7 @@ class CustomBlockListTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('block', 'custom_block');
public static $modules = array('block', 'custom_block', 'config_translation');
public static function getInfo() {
return array(
......@@ -35,7 +35,7 @@ public static function getInfo() {
* Tests the custom block listing page.
*/
public function testListing() {
$this->drupalLogin($this->drupalCreateUser(array('administer blocks')));
$this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'translate configuration')));
$this->drupalGet('admin/structure/block/custom-blocks');
// Test for the page title.
......
......@@ -174,7 +174,10 @@ function config_translation_config_translation_info(&$info) {
*/
function config_translation_entity_operation(EntityInterface $entity) {
$operations = array();
if (\Drupal::currentUser()->hasPermission('translate configuration')) {
$entity_type = $entity->getEntityType();
if ($entity_type->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface') &&
$entity->hasLinkTemplate('drupal:config-translation-overview') &&
\Drupal::currentUser()->hasPermission('translate configuration')) {
$operations['translate'] = array(
'title' => t('Translate'),
'weight' => 50,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment