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
-24
lines changed Expand file tree Collapse file tree 2 files changed +7
-24
lines changed Original file line number Diff line number Diff 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 */
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