Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: #12545

Closed
slebbo opened this issue Jan 17, 2023 · 4 comments
Closed

[4.x]: #12545

slebbo opened this issue Jan 17, 2023 · 4 comments
Assignees

Comments

@slebbo
Copy link

slebbo commented Jan 17, 2023

What happened?

Description

Opening preview from an asset field (single-click) stripping all <h1>-tags on all Redactor fields.

Steps to reproduce

  1. Create an Entry Type with an Asset field and a Redactor field
  2. Edit the redactor field to have at least one <h1>-tag
  3. Add an image to the asset field
  4. Single-click (don't double click) the image asset's thumbnail to open the preview modal

Expected behavior

No content adjustments

Actual behavior

The <h1> tag gets removed from the Redactor-field when Preview Modal opens

Possible source of bug / solution

In the vendor/craftcms/cms/src/web/assets/cp/dist/cp.js file I commented out this:

_addModalName: function () {
              var t = "preview-heading";
              this.$container
                .prepend(
                  $("h1")
                    .attr({ class: "visually-hidden", id: t })
                    .text(Craft.t("app", "Preview file"))
                )
                .attr("aria-labelledby", t);
            },

The source file seems to be named PreviewFileModal.js

Commenting those lines out got rid of the bug, but it's not really a bug fix.

Craft CMS version

4.3.5

PHP version

8.0.24

Operating system and version

Linux 5.10.104-linuxkit (ddev)

Database type and version

MySQL 10.4.26 (MariaDB)

Image driver and version

Imagick 3.6.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

  • Redactor 3.0.3
@mmikkel
Copy link
Contributor

mmikkel commented Jan 17, 2023

Happening on my end too, and it doesn't seem isolated to Redactor fields. For example, the entry title <h1> (i.e. .screen-title) disappears when triggering the image preview from an asset field in an entry edit page, with no plugins installed (Craft 4.3.6.1).

@i-just
Copy link
Contributor

i-just commented Jan 18, 2023

Hi both! Thanks for reporting and for doing most of the hard work for me :)
I created a PR that should solve this issue.

@brandonkelly
Copy link
Member

This is fixed now for the next release, via #12546.

@brandonkelly
Copy link
Member

Craft 4.3.7 has been released with that fix.

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

No branches or pull requests

4 participants