Skip to content

Commit

Permalink
coder stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Stanley committed Aug 18, 2020
1 parent 9a736c0 commit cbab079
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 0 additions & 2 deletions islandora.module
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ function islandora_entity_view_mode_alter(&$view_mode, EntityInterface $entity)
}
}



/**
* Implements hook_preprocess_node().
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ class MediaSourceController extends ControllerBase {
/**
* MediaSourceController constructor.
*
* @param \Drupal\Core\File\FileSystem
* @param \Drupal\Core\File\FileSystem $fileSystem
* Filesystem service.
*/


public function __construct(FileSystem $fileSystem) {
$this->fileSystem = $fileSystem;
}
Expand All @@ -67,6 +65,24 @@ public static function create(ContainerInterface $container) {
);
}

/**
* Attaches incoming file to existing media.
*
* @param \Drupal\media\Entity\Media $media
* Media to hold file.
* @param string $destination_field
* Media field to hold file.
* @param string $destination_text_field
* Media field to hold extracted text.
* @param \Symfony\Component\HttpFoundation\Request $request
* HTTP Request from Karaf.
*
* @return \Symfony\Component\HttpFoundation\Response
* HTTP response.
*
* @throws \Drupal\Core\Entity\EntityStorageException
* @throws \Drupal\Core\TypedData\Exception\ReadOnlyException
*/
public function attachToMedia(
Media $media,
string $destination_field,
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/MediaSourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function attachToMedia(
]);
$media->save();
}
else{
else {
$this->getLogger('islandora')->warning("Field $destination_field is not defined in Media Type {$media->bundle()}");
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Plugin/Condition/MediaSourceHasMimetype.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class MediaSourceHasMimetype extends ConditionPluginBase {
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {


$form['mimetype'] = [
'#title' => $this->t('Source Media Mimetype'),
'#type' => 'textfield',
Expand Down

0 comments on commit cbab079

Please sign in to comment.