Commit d1c5abdf authored by phenaproxima's avatar phenaproxima

Issue #3042587 by i-trokhanenko, katherined, kavbiswa: Remove deprecated...

Issue #3042587 by i-trokhanenko, katherined, kavbiswa: Remove deprecated function calls and raise the minimum version of core to 8.7
parent 59902c8c
......@@ -5,4 +5,5 @@ package: Media
type: module
dependencies:
- drupal:image
- drupal:system (>=8.7)
- drupal:user
......@@ -102,7 +102,7 @@ class CropTypeListBuilder extends ConfigEntityListBuilder {
$usage = [];
foreach ($image_styles as $image_style) {
if (count($usage) < 2) {
$usage[] = $image_style->link();
$usage[] = $image_style->toLink(NULL, 'edit-form')->toString();
}
}
......
......@@ -99,7 +99,7 @@ class CropTypeDeleteForm extends EntityConfirmFormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->entity->delete();
$t_args = ['%name' => $this->entity->label()];
drupal_set_message($this->t('The crop type %name has been deleted.', $t_args));
$this->messenger()->addMessage($this->t('The crop type %name has been deleted.', $t_args));
$this->logger('crop')->notice('Deleted crop type %name.', $t_args);
$form_state->setRedirectUrl($this->getCancelUrl());
......
......@@ -171,10 +171,10 @@ class CropTypeForm extends EntityForm {
$t_args = ['%name' => $type->label()];
if ($status == SAVED_UPDATED) {
drupal_set_message($this->t('The crop type %name has been updated.', $t_args));
$this->messenger()->addMessage($this->t('The crop type %name has been updated.', $t_args));
}
elseif ($status == SAVED_NEW) {
drupal_set_message($this->t('The crop type %name has been added.', $t_args));
$this->messenger()->addMessage($this->t('The crop type %name has been added.', $t_args));
$context = array_merge($t_args, ['link' => Link::createFromRoute($this->t('View'), 'crop.overview_types')->toString()]);
$this->logger('crop')->notice('Added crop type %name.', $context);
}
......
......@@ -113,7 +113,7 @@ abstract class CropUnitTestBase extends KernelTestBase {
* File object.
*/
protected function getTestFile() {
file_unmanaged_copy(drupal_get_path('module', 'crop') . '/tests/files/sarajevo.png', PublicStream::basePath());
\Drupal::service('file_system')->copy(drupal_get_path('module', 'crop') . '/tests/files/sarajevo.png', PublicStream::basePath());
return $this->fileStorage->create([
'uri' => 'public://sarajevo.png',
'status' => FILE_STATUS_PERMANENT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment