Skip to content

Image details cannot be updated in new media gallery when JS Minificaiton is enabled #31633

Closed
@thomas-kl1

Description

@thomas-kl1

Preconditions (*)

  1. Magento 2.4-develop
  2. M2.4.*
  3. Enable built-in JS Minification (production mode) ( bin/magento config:set dev/js/minify_files 1 )
  4. DIsable old media gallery ( Stores -> Configuration -> System -> Media Gallery and set Enable Old Media Gallery to No)

Steps to reproduce (*)

  1. Go to Admin -> Catalog -> Categories -> Content -> Select from Gallery
  2. Open the context menu for any image (3 dots) and select "Edit"
  3. Enter image title, description, add keywords
  4. Click "Save"

Expected result (*)

Image details are saved

Actual result (*)

Image details are not saved. Uncaught TypeError: Cannot read property 'call' of undefined in jquery.validate

There are JS console errors when media gallery is opened:
Uncaught SyntaxError: Invalid regular expression: missing / validate-image-title.min.js:1
Uncaught SyntaxError: Invalid regular expression: missing / validate-image-description.min.js:1

Screenshot from 2021-01-13 12-53-12

Before/After Minification of the regex:

/^[a-zA-Z0-9\-\_\.\,\n\ ]+$|^$/i.test(value);
/^[a-zA-Z0-9\-\_\.\,\]+$/i.test(value);

Space and new line are escaped and not recognized as part of the regex. Also regarding the JSShrink issues, it looks like there plenty of issues with regex, isn't any other working library? https://github.com/tedious/JShrink/issues


  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: MediaGalleryFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: ready for confirmationPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions