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

Commit e299c1e

Browse files
committed
Issue #2655844 by Berdir: Remove file_entity_entity_base_field_info()
1 parent 127ab88 commit e299c1e

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

file_entity.module

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -559,34 +559,6 @@ function file_entity_file_download($uri) {
559559
* @} End of "defgroup file_entity_access".
560560
*/
561561

562-
/**
563-
* @name pathauto_file Pathauto integration for the core file module.
564-
* @{
565-
*/
566-
567-
// @todo move
568-
function file_entity_entity_base_field_info(EntityTypeInterface $entity_type) {
569-
// @todo: Make this configurable and/or remove if
570-
// https://drupal.org/node/476294 is resolved.
571-
if (\Drupal::moduleHandler()->moduleExists('pathauto') && $entity_type->id() == 'file') {
572-
$fields = array();
573-
$fields['path'] = BaseFieldDefinition::create('path')
574-
->setCustomStorage(TRUE)
575-
->setLabel(t('URL alias'))
576-
->setTranslatable(TRUE)
577-
->setDisplayOptions('form', array(
578-
'type' => 'path',
579-
'weight' => 30,
580-
))
581-
->setDisplayConfigurable('form', TRUE);
582-
return $fields;
583-
}
584-
}
585-
586-
/**
587-
* @} End of "name pathauto_file".
588-
*/
589-
590562
/**
591563
* Checks if pattern(s) match mimetype(s).
592564
*/

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)