On a completely clean checkout of the 4.1dev branch do the usual composer install and npm ci
Then try to install joomla
If I change
to
->registerAndUseStyle('template.installation', 'installation/template/css/template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css')
Then I get the expected result.
Has something changed or am I going mad?
Labels |
Added:
No Code Attached Yet
|
weird
@brianteeman what's your local server's setup? eg localhost but the current installation is a folder (or folders) deeper?
localhost/joomla-cms
it's weird because the nightly build installs fine. so it must be something in the npm build scripts. gave up trying to work it out for now.
@brianteeman this is a bug your proposal is correct. My bad
Check #37292
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-16 12:20:43 |
Closed_By | ⇒ | richard67 |
How then is it working for me on a fresh branch? Strange.
Yes, I am wondering about the same #37292 (comment)
are you in a subdirectory?
@chmst @brianteeman @richard67 my guess is that somehow the $relative
argument is passed wrongly here:
joomla-cms/libraries/src/HTML/HTMLHelper.php
Line 412 in 8f862d6
OR the installation template options (either inheritable or parent) are wrongly set
No, I'm not in a subdirectory. I have an Apache Vhosts environment where Joomla is in the root of the particular VHost.
@dgrammatiko Hmm, the method is named "isPathAbsolute", but it returns true if the given path exists below the Joomla root, i.e. is relative, and the doc block says "Check if the Path is relative to /media folder or absolute", which sounds as if it should do that, but then the name of that method would be wrong.
I would know whom to ask now, but I fear that one is currently not available due to reasons (sad).
@brianteeman could you please add
var_dump([is_file(JPATH_ROOT . '/' . $path) => $path]);
before
and share the results for the installation page?@richard67 sadly yes
I am in xampp/htdocs/joomla-4 - a new empty directory, pulled the latests 4.1-dev, so everything as usual.
The results on a working install in the subdirectory are
array(1) {
[1]=>
string(38) "installation/template/css/template.css"
}
array(1) {
[0]=>
string(50) "vendor/joomla-custom-elements/joomla-alert.min.css"
}
array(1) {
[0]=>
string(18) "system/core.min.js"
}
array(1) {
[0]=>
string(46) "vendor/webcomponentsjs/webcomponents-bundle.js"
}
array(1) {
[0]=>
string(27) "system/keepalive-es5.min.js"
}
array(1) {
[0]=>
string(29) "system/fields/validate.min.js"
}
array(1) {
[0]=>
string(26) "system/messages-es5.min.js"
}
array(1) {
[0]=>
string(36) "system/joomla-core-loader-es5.min.js"
}
array(1) {
[0]=>
string(23) "system/keepalive.min.js"
}
array(1) {
[1]=>
string(36) "installation/template/js/template.js"
}
array(1) {
[0]=>
string(22) "system/messages.min.js"
}
array(1) {
[0]=>
string(32) "system/joomla-core-loader.min.js"
}
and the results with the current (non-working) code is
array(1) {
[1]=>
string(12) "template.css"
}
array(1) {
[0]=>
string(50) "vendor/joomla-custom-elements/joomla-alert.min.css"
}
array(1) {
[0]=>
string(18) "system/core.min.js"
}
array(1) {
[0]=>
string(46) "vendor/webcomponentsjs/webcomponents-bundle.js"
}
array(1) {
[0]=>
string(27) "system/keepalive-es5.min.js"
}
array(1) {
[0]=>
string(29) "system/fields/validate.min.js"
}
array(1) {
[0]=>
string(26) "system/messages-es5.min.js"
}
array(1) {
[0]=>
string(36) "system/joomla-core-loader-es5.min.js"
}
array(1) {
[0]=>
string(23) "system/keepalive.min.js"
}
array(1) {
[1]=>
string(36) "installation/template/js/template.js"
}
array(1) {
[0]=>
string(22) "system/messages.min.js"
}
array(1) {
[0]=>
string(32) "system/joomla-core-loader.min.js"
}
Hmm, the function seems to return true if the path exists as relative path directly below the Joomla root, and false if that is a relative path not directly below the joomla root but somewhere deeper. so the name of the method might be misleading indeed, but it seems to do what it shall do for its usage.
Update: That was for the first test by Brian. In the 2nd test the first output seems to be wrong.
Ok, this doesn't make any sense,
array(1) {
[1]=>
string(12) "template.css"
}
the result should be
array(1) {
[0]=>
string(12) "template.css"
}
but it seems to do what it shall do for its usage.
Not really in the second case it's wrong
Yes, I had only commented the first case.
@brianteeman do you have a file template.css
under the root folder?
Let me check. Iv been doing some template work, maybe a file got left in the wrong place
That was it. my bad
I still think the pr is good though
I still think the pr is good though
I agree.
That was it. my bad
Not really your fault. The heuristics used for deciding how to treat a path is undocumented and this is one of the edge cases that the logic will fail. Might worth couple of lines in the docs
as soon as you mentioned the subdirectory I just assumed it was another one of your mistakes ;)
No problem here. Working on win11, xampp, php 8.0.