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

[Bug] Icon Library Problems #17395

Open
3 tasks
fashxp opened this issue Jul 24, 2024 · 4 comments
Open
3 tasks

[Bug] Icon Library Problems #17395

fashxp opened this issue Jul 24, 2024 · 4 comments

Comments

@fashxp
Copy link
Member

fashxp commented Jul 24, 2024

Pimcore version

2024.2

Steps to reproduce

open icon library

Actual Behavior

  • JS errors when opening
    image

  • click on icons with green border has no effect
    image

  • click on icon does not copy path to clipboard

Expected Behavior

no errors...

@kingjia90
Copy link
Contributor

kingjia90 commented Jul 25, 2024

mhh, weird, all the listed problems are originated by jQuery being somehow blocked by buttons.github.io/buttons.js.

So it is only broken on debug mode as per
https://github.com/pimcore/admin-ui-classic-bundle/blob/fa2d03aaeb4787e1813f71f6a7ec58b28cd820cb/templates/admin/login/layout.html.twig#L45-L50

On demo seems working fine
image
(by opening icon library when editing a data object class) and even locally on dev mode

@kingjia90
Copy link
Contributor

But the mentioned github button is appearing only on login page, not sure how it can be reproduced, looks like it is logging out/expiring session somehow on some icon and it's in-lining the login page content instead of the image or things like that.

I see a i am content script in the console log, is it part of some front end tests?

@fashxp
Copy link
Member Author

fashxp commented Jul 25, 2024

Hmm problem appreared in fresh installation of skeleton in prod env

@podarcis
Copy link
Contributor

podarcis commented Jul 26, 2024

The error output regarding GitHub buttons JavaScript is misleading - it's just the CSP header's value.

I think the reason for this error is that the icon-list template includes the jQuery lib from external source, but the URL is not listed in CSP allow list:

<script
    src="https://code.jquery.com/jquery-3.7.1.min.js"
    integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
    crossorigin="anonymous"></script>

https://github.com/pimcore/admin-ui-classic-bundle/blob/v1.5.1/templates/admin/misc/icon_list.html.twig#L127

        self::SCRIPT_OPT => [
            'https://buttons.github.io/buttons.js', // GitHub star button on login page
        ],

https://github.com/pimcore/admin-ui-classic-bundle/blob/v1.5.1/src/Security/ContentSecurityPolicyHandler.php#L57

So a quick fix could be to include the jQuery CDN as well in der CSP.

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

3 participants