Feature Information Required PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar sinahaghparast
sinahaghparast
9 Apr 2024

Pull Request for Issue # .

Summary of Changes

Code be better...

Testing Instructions

https://validator.w3.org/

Actual result BEFORE applying this Pull Request

Validator message:
Info: The type attribute is unnecessary for JavaScript resources.
Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.

Expected result AFTER applying this Pull Request

Validator message:
Document checking completed. No errors or warnings to show.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar sinahaghparast sinahaghparast - open - 9 Apr 2024
avatar sinahaghparast sinahaghparast - change - 9 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2024
Category Front End com_content Layout Libraries Plugins
avatar brianteeman
brianteeman - comment - 9 Apr 2024

Before jumping in and "fixing" the code you really need to spend a little more time both using Joomla dn looking through the code history.

For example you will find that the "itemprop" you are adding here has only just been removed because we switched to use json rich snippets see #41151 so adding it here is completely wrong.

Secondly a pull request should address a single issue. Here you are addressing two unrelated issues

avatar sinahaghparast sinahaghparast - change - 9 Apr 2024
Labels Added: PR-5.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2024
Category Front End com_content Layout Libraries Plugins Layout Libraries Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2024
Category Front End Layout Libraries Plugins Libraries Front End Plugins
avatar sinahaghparast
sinahaghparast - comment - 9 Apr 2024

I removed itemprop...

avatar brianteeman
brianteeman - comment - 9 Apr 2024

I removed itemprop...

Now you need to make sure the pull request title and description are still correct and if not then you will need to edit those. The title is particularly important as that is what people will seein the changelog

avatar sinahaghparast sinahaghparast - change - 9 Apr 2024
Title
5.2-Styles and Script element in head-Meta tag in HTML-Add itemprop to some elements
5.2-Styles and Script element in head
avatar sinahaghparast sinahaghparast - edited - 9 Apr 2024
avatar sinahaghparast sinahaghparast - change - 9 Apr 2024
The description was changed
avatar sinahaghparast sinahaghparast - edited - 9 Apr 2024
avatar brianteeman
brianteeman - comment - 9 Apr 2024

the javascript renderer for the debug plugin is not in the head. It is just before the closing body tag. You probably should also fix the css for that plugin as well.

image

avatar dgrammatiko
dgrammatiko - comment - 10 Apr 2024

The code for the debug css is here:

$html .= sprintf('<link rel="stylesheet" type="text/css" href="%s">' . "\n", $file);

For the JS is here:
$html .= sprintf('<script type="text/javascript" src="%s" defer></script>' . "\n", $file);

Also just reviewing the code the nonce attribute needs to be applied for each stylesheet/script, right now debug is probably broken with CSP enabled

avatar sinahaghparast
sinahaghparast - comment - 16 Apr 2024

I apologize for the delay. It was related to my personal life.

According to this document, external files can also have the nonce attribute. what is your opinion? be added?

avatar sinahaghparast
sinahaghparast - comment - 16 Apr 2024

Also, I don't agree with adding the nonce attribute to the inline style. Because according to this document, the code inside the elements are also blocked.

Inline style attributes are also blocked:
<div style="display:none">Foo</div>

avatar dgrammatiko
dgrammatiko - comment - 16 Apr 2024

Also, I don't agree with adding the nonce attribute to the inline style. Because according to this document, the code inside the elements are also blocked.

You misunderstood what the inline style it refers to. It's not the <style> tag but rather the attribute style="display: none".

Screenshot 2024-04-16 at 6 48 11 PM

FWIW Joomla is already adding the nonce for the head inline css/js tags.

avatar sinahaghparast
sinahaghparast - comment - 16 Apr 2024

If I have misunderstood, then you guide me so that I can be informed. Just stating that I got it wrong won't help me. It may be repeated until the offender realizes his mistake. Please introduce new document or interpret that document.

avatar dgrammatiko
dgrammatiko - comment - 16 Apr 2024

CSP has different levels. The strict level is the one that does not allow inline css (attribute style). I'm not sure how I can explain this better as the CSP chapter is pretty big and needs some studying to grasp the fundamentals. MDN and web.dev are good starting points, then more googling are my only suggestions here if the comments are not sufficient

avatar sinahaghparast
sinahaghparast - comment - 16 Apr 2024

I read a page from the MDN website. And I understood such a concept. Anyway, I trust your words. Are the current changes acceptable?

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
5.2-Styles and Script element in head
[5.2] 5.2-Styles and Script element in head
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar sinahaghparast sinahaghparast - change - 14 May 2024
Labels Added: Feature
avatar angieradtke
angieradtke - comment - 24 Aug 2024

trailing slash and needless attribute in debug bar removed :-)

avatar angieradtke angieradtke - test_item - 24 Aug 2024 - Tested successfully
avatar angieradtke
angieradtke - comment - 24 Aug 2024

I have tested this item ✅ successfully on b609e14


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43239.

avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.2] 5.2-Styles and Script element in head
[5.3] 5.2-Styles and Script element in head
avatar HLeithner HLeithner - edited - 2 Sep 2024
avatar richard67 richard67 - change - 15 Sep 2024
Labels Added: Information Required PR-5.3-dev
Removed: PR-5.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 15 Sep 2024
Category Front End Libraries Plugins Front End Plugins
avatar sinahaghparast sinahaghparast - change - 25 Sep 2024
Title
[5.3] 5.2-Styles and Script element in head
[5.3] 5.3-Styles and Script element in head
avatar sinahaghparast sinahaghparast - edited - 25 Sep 2024
avatar sinahaghparast
sinahaghparast - comment - 25 Sep 2024

@brianteeman
title and code edited.

avatar brianteeman
brianteeman - comment - 29 Sep 2024

@brianteeman title and code edited.

the title still says this is for the head

avatar sinahaghparast
sinahaghparast - comment - 29 Sep 2024

@brianteeman title and code edited.

the title still says this is for the head

@brianteeman
renderHead is function's name...
What do you recommend?

avatar dgrammatiko
dgrammatiko - comment - 29 Sep 2024

@sinahaghparast the debugbar injects the assets at the end of the body (although the class says head) so maybe instead of head should say debugbar or just debug?

avatar sinahaghparast
sinahaghparast - comment - 29 Sep 2024

@brianteeman title and code edited.

the title still says this is for the head

@brianteeman renderHead is function's name... What do you recommend?

I suggest to name the function "renderDebugAssets".
Is okay?

avatar sinahaghparast sinahaghparast - change - 29 Sep 2024
Title
[5.3] 5.3-Styles and Script element in head
[5.2] 5.2-Styles and Script element in rendering Debug Assets
avatar sinahaghparast sinahaghparast - edited - 29 Sep 2024
avatar richard67
richard67 - comment - 29 Sep 2024

I suggest to name the function "renderDebugAssets". Is okay?

@sinahaghparast I would not change the method name for b/c (backwards compatibility) reasons. But the title of your pull request is better now.

Add a Comment

Login with GitHub to post a comment