Skip to content
This repository was archived by the owner on Jan 5, 2018. It is now read-only.

Commit 97337bd

Browse files
committed
Issue #2655844 by Berdir: Remove file_entity_entity_base_field_info()
1 parent 9f7799d commit 97337bd

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

file_entity.module

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -303,30 +303,6 @@ function file_entity_file_download($uri) {
303303
return -1;
304304
}
305305

306-
/**
307-
* @name pathauto_file Pathauto integration for the core file module.
308-
* @{
309-
*/
310-
311-
// @todo move
312-
function file_entity_entity_base_field_info(EntityTypeInterface $entity_type) {
313-
// @todo: Make this configurable and/or remove if
314-
// https://drupal.org/node/476294 is resolved.
315-
if (\Drupal::moduleHandler()->moduleExists('pathauto') && $entity_type->id() == 'file') {
316-
$fields = array();
317-
$fields['path'] = BaseFieldDefinition::create('path')
318-
->setCustomStorage(TRUE)
319-
->setLabel(t('URL alias'))
320-
->setTranslatable(TRUE)
321-
->setDisplayOptions('form', array(
322-
'type' => 'path',
323-
'weight' => 30,
324-
))
325-
->setDisplayConfigurable('form', TRUE);
326-
return $fields;
327-
}
328-
}
329-
330306
/**
331307
* @} End of "name pathauto_file".
332308
*/

src/Tests/FileEntityPathautoTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ class FileEntityPathautoTest extends FileEntityTestBase {
2929
* Tests Pathauto support.
3030
*/
3131
public function testPathauto() {
32+
$this->config('pathauto.settings')
33+
->set('entity_types.file', TRUE)
34+
->save();
35+
36+
\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
37+
\Drupal::service('plugin.manager.alias_type')->clearCachedDefinitions();
38+
3239
$pattern = PathautoPattern::create([
3340
'id' => Unicode::strtolower($this->randomMachineName()),
3441
'type' => 'canonical_entities:file',

0 commit comments

Comments
 (0)