Hello,
After installing a site on a server with PDO, I noticed that the path of my frontend template files is changed and wrong.
/templates/nameofmytemplate
/administrator/templates/nameofmytemplate
Joomla 4.1.2
Database 10.3.34-MariaDB-0ubuntu0.20.04.1
PHP 7.4.3
Any idea how to fix this? (couldn't find something bout that on GH)
Labels |
Added:
No Code Attached Yet
|
P.S.: The workaround is to use MySQLi instead of Mysql (PDO) if you have both available.
The site works as expected on my server with MySQLi. I re-installed it on the production server of the client using kickstart from Akeeba. Unfortunately, they have on PDO on their server
Confirmed: the path to the front end template is displayed incorrectly when 'MySQL (PDO)' has been selected as Database Type, shown as 'mysql' in the file configuration.php.
Change it to 'MySQLi' and the path is displayed correctly.
He means that if you edit configuration.php by replacing public $dbtype = 'mysql';
by public $dbtype = 'mysqli';
then administrator is removed and the frontend template path is then correct
He means that if you edit configuration.php by replacing
public $dbtype = 'mysql';
bypublic $dbtype = 'mysqli';
then administrator is removed and the frontend template path is then correct
I understood that, I just don't understand what the "displayed" means. Are is the template folder of the frontend really located at the wrong place, so after changing the database type it needs to make a new installation to get it at the right place? Or is it just shown wrong somewhere in backend so after the change of the db type all is fine, without reinstalling?
The folder of the frontend template is located at the right place. It's just that in your backend, when you visit Site templates, open your template, then at the top you have there a wrong path as it contains /administrator, so of course you can't edit any files as the files are search under administrator folder, but there are under the /templates folder
confirmed
Now I understand .. sorry I was a bit slow, need more coffee maybe.
There must be some check somewhere like $item->client_id === 0
, which should be changed either to $item->client_id == 0
or to (int) $item->client_id === 0
. The latter is maybe better because easier to understand when reading. The first would risk to be "fixed" by someone in future when not adding a comment telling why not using strict (type safe) comparison.
I find that strict comparison for the client_id at several places in com_templates, but also find the 2 suggested changes from my previous comment at several places in the same files, so it seems not to be really consistent in that code.
Am working on it.
beat me to it.
beat me to it.
@brianteeman Means you are on it already?
I was but I stopped now
@brianteeman Go on ... I am at paid work now so can't do anything before tonight, and if you find the place before me, I'm happy to test.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-04-05 09:17:17 |
Closed_By | ⇒ | richard67 |
@Sandra97 How have you installed the site? Using the normal Joomla full installation package? Or anything special, like e.g. a quickstart installation from the hosting provider or template provider? I ask because I've seen the same issue reported at several places (forum, social media) for quickstart installations.