This repository was archived by the owner on Jan 5, 2018. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +7
-28
lines changed Expand file tree Collapse file tree 2 files changed +7
-28
lines changed Original file line number Diff line number Diff 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 */
Original file line number Diff line number Diff 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    $ patterncreate ([
3340      'id '  => Unicode::strtolower ($ this randomMachineName ()),
3441      'type '  => 'canonical_entities:file ' ,
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments