Commit c444e64b authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3288004 by eiriksm, Project Update Bot, sharayurajput: Automated Drupal...

Issue #3288004 by eiriksm, Project Update Bot, sharayurajput: Automated Drupal 10 compatibility fixes
parent 51ab3989
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
name: Imageshop
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
type: module
dependencies:
  - drupal:image
+3 −0
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ function imageshop_form_media_library_add_form_upload_alter(&$form, FormStateInt
  if (!in_array($type, $config)) {
    return;
  }
  if (empty($form["container"]["upload"]["#process"])) {
    return;
  }
  $form["container"]["upload"]["#type"] = 'imageshop';
  // We need to set the values before the media module does.
  array_unshift($form["container"]["upload"]["#process"], [
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ class ImageShopElement extends ManagedFile {
  /**
   * Validates the upload element.
   */
  public function validateMediaUploadElement(array $element, FormStateInterface $form_state) {
  public static function validateMediaUploadElement(array $element, FormStateInterface $form_state) {
    if ($form_state::hasAnyErrors()) {
      // When an error occurs during uploading files, remove all files so the
      // user can re-upload the files.
+1 −1
Original line number Diff line number Diff line
name: Imageshop testing
type: module
package: Testing
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ class MediaBrowserTest extends WebDriverTestBase {
    $element->pressButton('Add media');
    /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $session */
    $session = $this->assertSession();
    $session->assertWaitOnAjaxRequest();
    $element = $session->waitForElement('css', '.imageshop-trigger');
    $files = $this->container->get('entity_type.manager')->getStorage('file')->loadByProperties([]);
    self::assertEmpty($files);