Bug #101456
closed
type="text/javascript" is back
Added by Norbert Florineth over 1 year ago.
Updated 4 months ago.
Sprint Focus:
On Location Sprint
Description
Hello all,
as already written in ticket #97990 , the problem is unfortunately present again in the current version 11.5.30.
- Status changed from New to Needs Feedback
@Norbert Florineth can you add the code you used to reproduce the problem?
(TypoScript, Fluid, etc)
Thank you
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.
- Related to Task #97990: Remove type="text/javascript" added
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
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')
);
}
- Sprint Focus set to On Location Sprint
- Status changed from Needs Feedback to Closed
IMHO this has been solved in TYPO3 v12, and we won't fix this in v11, as this is not a priority issue.
If you feel this is the wrong decision or you can reproduce this in v12, let me know.
Also available in: Atom
PDF