Project

General

Profile

Actions

Bug #101456

open

type="text/javascript" is back

Added by Norbert Florineth 10 months ago. Updated 5 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2023-07-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hello all,
as already written in ticket #97990 , the problem is unfortunately present again in the current version 11.5.30.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #97990: Remove type="text/javascript"Closed2022-07-21

Actions
Actions #1

Updated by Andreas Kienast 10 months ago

  • Status changed from New to Needs Feedback

I'm confused. The mentioned patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/75383 was never ported to 11.5 at all.

Actions #2

Updated by Riccardo De Contardi 9 months ago

@Norbert Florineth can you add the code you used to reproduce the problem?
(TypoScript, Fluid, etc)

Thank you

Actions #3

Updated by Norbert Florineth 9 months ago

Hello @Riccardo De Contardi,
I did not use a special code. In a recent project i installed the extension mindshape_cookie_consent [[https://extensions.typo3.org/extension/mindshape_cookie_consent]] . After checking the project with the W3C validator, I saw that the problem was back. So I looked at the file mentioned in ticket #97990 and saw that "type" is there again.

Actions #4

Updated by Riccardo De Contardi 9 months ago

  • Related to Task #97990: Remove type="text/javascript" added
Actions #5

Updated by Riccardo De Contardi 9 months ago

On a fresh TYPO3 11.5.30 I added the following TS Code:

page.includeJS.myjs = /fileadmin/test.js
page.includeJS.bs = https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js

Result: in page (view source) I see:

<script src="/fileadmin/test.js?1691317340"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script>

Same with includeJSFooter

Actions #6

Updated by Riccardo De Contardi 5 months ago

I repeated the same test on my previous comment on 11.5.33 and I also installed mindshape/mindshape-cookie-consent (version 2.2.5)

The results are:

1) The script I've added still don't have the text/javascript text

2) BUT... cookie-consent added on the footer:

<script src="/typo3conf/ext/mindshape_cookie_consent/Resources/Public/JavaScript/cookie_consent.js?1702827111" type="text/javascript"></script>

If I am not wrong, the file is added by EXT:mindscape_cookie_consent/Classes/Hook/RenderPreprocessHook.php (lines 82-87):

                if (true === (bool)$settings['addJavaScript']) {
                    $pageRenderer->addJsFooterLibrary(
                        'cookie_consent',
                        PathUtility::getAbsoluteWebPath('typo3conf/ext/mindshape_cookie_consent/Resources/Public/JavaScript/cookie_consent.js')
                    );
                }
Actions

Also available in: Atom PDF