Skip to content

Pagebuilder content type extension mobile responsive bug | Prevents developers extending mobile functionality #38565

Open
@RickyGoacher

Description

@RickyGoacher

Preconditions and environment

  • Magento version: Adobe Commerce ver. 2.4.5

When attempting to extend a pagebuilder content type to add in additional functionality, if the content type already has an extension by default to add in the min-height option on mobile, the js/converter/style/min-height.js file will error preventing the user from saving the page or block.

This error is caused by the min-height input on mobile having an empty value, which is then returned as undefined by the min-height.js file.

image

The return statement in the toDom function cannot handle an undefined value.

return value.split(/\+|\-|\*|\//).length > 1 ? "calc(" + (0, _object.get)(data, name) + ")" : value;

Adding a conditional to check if value !== undefined prevents the error and allows the admin user to save the changes for the page or block.

if(value !== undefined) {
  return value.split(/\+|\-|\*|\//).length > 1 ? "calc(" + (0, _object.get)(data, name) + ")" : value;
}

Or adding a conditional to set the value of value if it's undefined

if(value === undefined) {
  value = '100px';
}

This error prevents developers from adding additional functionality to pagebuilder for mobile devices and i believe it also adds to the confusion when it comes to developing for pagebuilder.

Steps to reproduce

  1. Create an extension for a pagebuilder content type that already has a mobile form. For example, the banner content type or the row. (Confirm it has the min_height mobile option).
  2. Attempt to add additional functionality, for example an input or colour selector that if different for both mobile and desktop.
  3. Once the new functionality has been added, attempt to use it.
  4. Add a value on Desktop view, switch to mobile and add the mobile value, then attempt to save the page.
  5. The page wont save and will throw the error - Cannot read properties of undefined (reading 'split')
    Screenshot from 2024-04-02 11-13-45

Expected result

Extending pagebuilder content types which have the min-height option should not result in an error preventing the user from saving the page or block.

This prevents developers extending content types for mobile.

Actual result

Attempting to extend pagebuilder content types (which already have a mobile form) to add additional functionality for mobile view results in an error being thrown from min-height.js and prevents the user from saving the page or block.
Screenshot from 2024-04-02 11-13-45

Additional information

Screenshot from 2024-04-02 11-13-45

Release note

No response

Triage and priority

  • 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”.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: ContentComponent: PageBuilderIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions