Image selection failed, please make sure to select only image files

Created on 26 June 2023, over 1 year ago
Updated 11 October 2023, about 1 year ago

I installed DXPR Builder on an existing site (9.5.9), added a section, and then attempted to add an image media item, but I always get

Image selection failed, please make sure to select only image files

I tried using entity browsers I already had installed on the site, as well as DXPR Builder Media Browser, but none of them work. I also noticed that in the fine print at the bottom of the Media Browser section of General Settings it says

The Entity Browser has to be using the iFrame display plugin.

even though the DXPR Builder Media Browser was set to the modal display after installation. Not sure why that is. Just out of curiosity I set the DXPR Builder Media Browser to iFrame to see what would happen, but then the Media Browser modal appeared with

The requested page could not be found.

πŸ› Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary Grabby

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grabby
  • πŸ‡³πŸ‡±Netherlands jurriaanroelofs

    Hi Grabby,

    I noticed that you mentioned being on version 2.2.7. Just to confirm, are you sure you're currently using that version? It's worth mentioning that the bug you reported was actually a regression issue that occurred before version 2.2.7. However, it should have been resolved in the latest release, which is indeed 2.2.7 as of the time of writing this message.

    Please double-check your version to ensure that you're on the latest release. If you're already on version 2.2.7 and still experiencing the bug, please let us know so we can investigate further.

  • πŸ‡­πŸ‡ΊHungary Grabby

    I can confirm that I’m using 2.2.7.

  • πŸ‡ΊπŸ‡ΈUnited States Chris Matthews

    I'm running DXPR Builder 2.3.0 and ran into this issue today.

  • πŸ‡³πŸ‡±Netherlands jurriaanroelofs

    @Chris can you please provide steps to reproduce? We havne't been able to reproduce this problem yet.

  • πŸ‡ΊπŸ‡ΈUnited States Chris Matthews

    Hi Jurrian, I can't seem to reproduce other than the fact that when I click on the "Image Carousel" element and try to select an image from the Media Brower, when I click an image the first slot says: "-1 items selected." If I try to select five images, the first slot says: "-5 items selected"

    If I click "Select Image" in the Media Browser modal I get following message in my brower: Image selection failed, please make sure to select only image files

    The Log Messages shows:

    TypeError: Drupal\dxpr_builder\Controller\AjaxController::getImageUrl(): Argument #1 ($fileIds) must be of type array, null given, called in /code/web/modules/contrib/dxpr_builder/src/Controller/AjaxController.php on line 591 in Drupal\dxpr_builder\Controller\AjaxController->getImageUrl() (line 1277 of /code/web/modules/contrib/dxpr_builder/src/Controller/AjaxController.php).

    AND

    Warning: Undefined array key "entityIDs" in Drupal\dxpr_builder\Controller\AjaxController->ajaxCallback() (line 579 of /code/web/modules/contrib/dxpr_builder/src/Controller/AjaxController.php)
    
    #0 /code/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(2, 'Undefined array...', '/code/web/modul...', 579)
    #1 /code/web/modules/contrib/dxpr_builder/src/Controller/AjaxController.php(579): _drupal_error_handler(2, 'Undefined array...', '/code/web/modul...', 579)
    #2 [internal function]: Drupal\dxpr_builder\Controller\AjaxController->ajaxCallback()
    #3 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #4 /code/web/core/lib/Drupal/Core/Render/Renderer.php(583): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #5 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #6 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #7 /code/vendor/symfony/http-kernel/HttpKernel.php(182): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #8 /code/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #9 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #10 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #11 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #12 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #13 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #14 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #15 /code/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #16 /code/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #17 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #18 {main}

    And here are the Browser Console errors:

    services.settings: NetworkError: Network error: TypeError: NetworkError: Network request failed
        APIError resource://services-settings/RemoteSettingsClient.sys.mjs:111
        NetworkError resource://services-settings/RemoteSettingsClient.sys.mjs:115
        _adjustedError resource://services-settings/RemoteSettingsClient.sys.mjs:911
        maybeSync resource://services-settings/RemoteSettingsClient.sys.mjs:816
    Caused by: TypeError: NetworkError: Network request failed
        onerror resource://services-settings/Utils.sys.mjs:229
    BroadcastService: receivedBroadcastMessage: handler for remote-settings/monitor_changes threw error: NetworkError: Network error: TypeError: NetworkError: Network request failed
        APIError resource://services-settings/RemoteSettingsClient.sys.mjs:111
        NetworkError resource://services-settings/RemoteSettingsClient.sys.mjs:115
        _adjustedError resource://services-settings/RemoteSettingsClient.sys.mjs:911
        maybeSync resource://services-settings/RemoteSettingsClient.sys.mjs:816
    Caused by: TypeError: NetworkError: Network request failed
        onerror resource://services-settings/Utils.sys.mjs:229

    Failed to fetch https://firefox-api-proxy.cdn.mozilla.net/desktop/v1/recommendations?locale=en-US&region=US&count=30: NetworkError when attempting to fetch resource.

    
    <code>Uncaught Error: No DOM node set for aPlacesNode.
    node.type: 0. node.parent: [xpconnect wrapped nsINavHistoryResultNode]
        _getDOMNodeForPlacesNode chrome://browser/content/places/browserPlacesViews.js:116
        nodeMoved chrome://browser/content/places/browserPlacesViews.js:583
    Uncaught Error: No DOM node set for aPlacesNode.
    node.type: 0. node.parent: [xpconnect wrapped nsINavHistoryResultNode]
        _getDOMNodeForPlacesNode chrome://browser/content/places/browserPlacesViews.js:116
        nodeTitleChanged chrome://browser/content/places/browserPlacesViews.js:499
  • πŸ‡ΊπŸ‡ΈUnited States Chris Matthews

    I can also reproduce this on https://try.dxpr.com

  • Status changed to Fixed about 1 year ago
  • πŸ‡³πŸ‡±Netherlands jurriaanroelofs

    This was fixed in 2.5.3, thanks everyone!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024