Crud: select2_from_ajax is not working on Edge

Created on 6 May 2020  路  2Comments  路  Source: Laravel-Backpack/CRUD

Bug report

What I did

I set up a select2_from_ajax field.

What I expected to happen

Ajax select to work.

What happened

In Microsoft Edge, it says syntax error.

What I've already tried to fix it

I found the syntax error, please take a look:
image

Also, I can see the same issue in these files:
vendorbackpackcrudsrcresourcesviewscrudfieldsselect2_from_ajax_multiple.blade.php:
95: var $selectedOptions = JSON.parse(element.attr('data-selected-options') ?? '[]');

vendorbackpackcrudsrcresourcesviewscrudfieldsselect2_from_ajax.blade.php:
111: var $selectedOptions = JSON.parse(element.attr('data-selected-options') ?? null); // not working

vendorbackpackcrudsrcresourcesviewscrudfieldsrelationshipfetch_or_create.blade.php:
458: var $selectedOptions = JSON.parse(element.attr('data-selected-options') ?? null);

vendorbackpackcrudsrcresourcesviewscrudfieldsrelationshipfetch.blade.php:
193: var $selectedOptions = JSON.parse(element.attr('data-selected-options') ?? null);

vendorbackpackcrudsrcresourcesviewscrudfieldsrelationshiprelationship_select.blade.php:
139: var $selectedOptions = JSON.parse(element.attr('data-selected-options') ?? null);

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

PHP 7.4.0 (cli) (built: Nov 27 2019 10:14:18) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

LARAVEL VERSION:

v7.10.1@d92e25358e85a962f1f868376f14935eb8ac53d6

BACKPACK VERSION:

4.1.x-dev@585cbabef25506ccd8570f4bab0828435a204aea

Bug

Most helpful comment

All 2 comments

This is the same issue as #2957

I'v submited the PR: #3024 to fix it.

Let's keep the discussion in that thread.

Thanks for taking time to submit the issue report and a PR for it. We really appreciate the effort.

Wish you the best,
Pedro

Was this page helpful?
0 / 5 - 0 ratings