[bug] admin.css is loaded from site side #974

Closed
opened 2023-02-15 17:54:12 +00:00 by jcodewalker · 11 comments

Steps to reproduce the issue

Compile and install demo component

Expected result

admin.css loaded from admin side like "/administrator/component..."

Actual result

admin.css link is "/components/com_demo/assets/css/admin.css"

System information (as much as possible)

  • OS Name & Version:
  • MySql Version:
  • Apache Version:
  • PHP Version:
  • Joomla Version:
  • JCB Version: 3.1.13
  • Browser:

Additional comments

### Steps to reproduce the issue Compile and install demo component ### Expected result admin.css loaded from admin side like "/administrator/component..." ### Actual result admin.css link is "/components/com_demo/assets/css/admin.css" ### System information (as much as possible) - OS Name & Version: - MySql Version: - Apache Version: - PHP Version: - Joomla Version: - JCB Version: 3.1.13 - Browser: ### Additional comments
Owner

Please note that the script is referenced as follows:

<script src="components/com_demo/assets/js/admin.css"></script>

It is not referenced as:

<script src="/components/com_demo/assets/js/admin.css"></script>

image

As you can see from the attached image, this is a relative path and does successfully load the admin area CSS file.

While we could make it a root-relative link, using a relative path to the application entry-point is more appropriate, especially as we move towards potentially implementing a dynamic admin path.

If you have any further questions or concerns, please let me know and I will be happy to address them.

Please note that the script is referenced as follows: ``` <script src="components/com_demo/assets/js/admin.css"></script> ``` It is not referenced as: ``` <script src="/components/com_demo/assets/js/admin.css"></script> ``` ![image](/attachments/d50d41d2-6767-44c3-b495-3faeed789b5c) As you can see from the attached image, this is a relative path and does successfully load the admin area CSS file. While we could make it a root-relative link, using a relative path to the application entry-point is more appropriate, especially as we move towards potentially implementing a dynamic admin path. If you have any further questions or concerns, please let me know and I will be happy to address them.
Author

Hello,
thanks for your answer, I didn't see the difference at first glance. I'm haveing some troubles with this new JCB version but perhaps they come from the server. I'm working with the ISP support to understand were these issues come from really.

By the way, JCB adds a css code automatically to the admin css file. It adds:

.no-click {
	pointer-events: none;
}

at the biginning of administrator/assets/css/admin.css file and disabling it in the firefox inspector affects the result in the page (still, not sure it's really related to it, but if I don't set it in the css area I shouldn't get it out of the compiler).

Still, this admin.css file is not added to dashboard view (yes, I need to manage something there). Not a big deal as I can do it with a code but should be interesting to know if it's temporary and you are going to add it to the dashboard too on next version or we have to add it manually.

Thanks a lot for your effort.

Hello, thanks for your answer, I didn't see the difference at first glance. I'm haveing some troubles with this new JCB version but perhaps they come from the server. I'm working with the ISP support to understand were these issues come from really. By the way, JCB adds a css code automatically to the admin css file. It adds: ``` .no-click { pointer-events: none; } ``` at the biginning of administrator/assets/css/admin.css file and disabling it in the firefox inspector affects the result in the page (still, not sure it's really related to it, but if I don't set it in the css area I shouldn't get it out of the compiler). Still, this admin.css file is not added to dashboard view (yes, I need to manage something there). Not a big deal as I can do it with a code but should be interesting to know if it's temporary and you are going to add it to the dashboard too on next version or we have to add it manually. Thanks a lot for your effort.
Owner

The CSS is added to the dashboard... Let me try this again.

image

So I add this css:
image

Compiler, install and reload/refresh (make sure to press [shift+F5]) the page:
image

So the CSS is on the dashboard that is for sure!

The .no-click is a long standing fix for a radio field issue that needs that if the field should be disabled because of permission restraint. Should not cause any trouble as its a class we add to the field at that point.
image

You know you can add more tabs (to the dashboard) and even build your own Dashboard right?

The CSS is added to the dashboard... Let me try this again. ![image](/attachments/cc037b71-15c5-4a27-9da5-5eb50b904f3c) So I add this css: ![image](/attachments/d2939fdd-2698-4b63-b64f-7ad820cd86b1) Compiler, install and reload/refresh (make sure to press [shift+F5]) the page: ![image](/attachments/0e531051-2a97-405f-9a5c-d743204de3a0) So the CSS is on the dashboard that is for sure! The `.no-click` is a long standing fix for a radio field issue that needs that if the field should be disabled because of permission restraint. Should not cause any trouble as its a class we add to the field at that point. ![image](/attachments/257508fd-2f32-4749-a5c7-08b7b61d7909) You know you can add more tabs (to the dashboard) and even build your own Dashboard right?
Author

Hello,

Thanks a lot for your support.

Unfortunately I'm not able to get the black background. At least I know it's not related to JCB.
Thank you!

Hello, Thanks a lot for your support. Unfortunately I'm not able to get the black background. At least I know it's not related to JCB. Thank you!
Owner

You are on JCB 3.1.17 right?

You are on [JCB 3.1.17](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip) right?
Author

Hello, no, 3.1.13 which should be the latest stable version.
But I'm quite sure now it's related to something in the server.
Bear with me.
Thanks a lot!

Hello, no, 3.1.13 which should be the latest stable version. But I'm quite sure now it's related to something in the server. Bear with me. Thanks a lot!
Author

BTW with this 3.1.18 version, new placeholders are not automatically enclosed with square brackets. Now I have to add them manually. Just to let you know.

BTW with this 3.1.18 version, new placeholders are not automatically enclosed with square brackets. Now I have to add them manually. Just to let you know.
Owner

You should be aware that JCB is built using JCB itself and is continuously updated (whenever a change is made, it is compiled, installed, and immediately becomes part of JCB). Therefore, if what you are suggesting were true, JCB would not be able to build, and there would be no releases. The fact that there are regular releases is proof that all core features are functioning properly, as JCB uses them to build itself.

That being said, I would suspect that a misconfiguration of PHP or other system components could possibly be contributing to the issue. If I haven't asked this already, what version of PHP are you currently running?

JCB is known to work very well on PHP7.4

When it comes to the use of placeholders, we have two areas being targeted: one that uses ###...### and the other that uses [[[...]]]. I have tried to ensure that the [[[...]]] placeholders are used exclusively for user-created placeholders. However, given the number of things we are currently moving around, it is possible that some of these placeholders may be mismatched. Nevertheless, as I mentioned earlier, every time we make a change, I build JCB with those changes. Since I am monitoring the Git changes, I can quickly identify any issues that arise.

It sounds like your use-case may be different from what I am currently focusing on, so I would need more specific details about where you are encountering the issue in order to provide assistance. JCB is a very large project, and it is possible that I may have missed something, which is why specific details are always helpful. Stating that placeholders don't work is a very broad statement, given that placeholders are obviously functioning properly, as evidenced by JCB's existence. If you can provide me with more details about what you are trying to do, what you expect to see, and in what area or context, as well as any relevant screenshots, it would help me to better understand the issue and assist with debugging. Without this information, I am unable to do much to help.

You should be aware that JCB is built using JCB itself and is continuously updated (whenever a change is made, it is compiled, installed, and immediately becomes part of JCB). Therefore, if what you are suggesting were true, JCB would not be able to build, and there would be no releases. The fact that there are regular releases is proof that all core features are functioning properly, as JCB uses them to build itself. That being said, I would suspect that a misconfiguration of PHP or other system components could possibly be contributing to the issue. If I haven't asked this already, what version of PHP are you currently running? JCB is known to work very well on PHP7.4 When it comes to the use of placeholders, we have two areas being targeted: one that uses `###`...`###` and the other that uses `[[[`...`]]]`. I have tried to ensure that the `[[[`...`]]]` placeholders are used exclusively for user-created placeholders. However, given the number of things we are currently moving around, it is possible that some of these placeholders may be mismatched. Nevertheless, as I mentioned earlier, every time we make a change, I build JCB with those changes. Since I am monitoring the Git changes, I can quickly identify any issues that arise. It sounds like your use-case may be different from what I am currently focusing on, so I would need more specific details about where you are encountering the issue in order to provide assistance. JCB is a very large project, and it is possible that I may have missed something, which is why specific details are always helpful. Stating that placeholders don't work is a very broad statement, given that placeholders are obviously functioning properly, as evidenced by JCB's existence. If you can provide me with more details about what you are trying to do, what you expect to see, and in what area or context, as well as any relevant screenshots, it would help me to better understand the issue and assist with debugging. Without this information, I am unable to do much to help.
Owner

Then, please open a new issue once you have more details, as this is now off topic ;)

Then, please open a new issue once you have more details, as this is now off topic ;)
Author

Sorry, my fault!
I was adding placeholders to view and expecting the placeholder to be automatically enclosed in square brakets as it happens when creating a new placeholder.
So sorry!

Sorry, my fault! I was adding placeholders to view and expecting the placeholder to be automatically enclosed in square brakets as it happens when creating a new placeholder. So sorry!
Author

I meant adding placeholders to component (obviously)... and expecting the same behavior as in creating new placeholder.

I meant adding placeholders to component (obviously)... and expecting the same behavior as in creating new placeholder.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#974
No description provided.