No Code Attached Yet
avatar Sandra97
Sandra97
5 Apr 2022

Hello,

After installing a site on a server with PDO, I noticed that the path of my frontend template files is changed and wrong.

Expected result

/templates/nameofmytemplate

Actual result

/administrator/templates/nameofmytemplate

System information (as much as possible)

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)

avatar Sandra97 Sandra97 - open - 5 Apr 2022
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Apr 2022
avatar richard67
richard67 - comment - 5 Apr 2022

@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.

avatar richard67
richard67 - comment - 5 Apr 2022

P.S.: The workaround is to use MySQLi instead of Mysql (PDO) if you have both available.

avatar Sandra97
Sandra97 - comment - 5 Apr 2022

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

avatar toivo
toivo - comment - 5 Apr 2022

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.


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

avatar richard67
richard67 - comment - 5 Apr 2022

@toivo What do you mean with "displayed"? Displayed where?

avatar Sandra97
Sandra97 - comment - 5 Apr 2022

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

avatar richard67
richard67 - comment - 5 Apr 2022

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

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?

avatar Sandra97
Sandra97 - comment - 5 Apr 2022

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

1

avatar brianteeman
brianteeman - comment - 5 Apr 2022

confirmed

avatar richard67
richard67 - comment - 5 Apr 2022

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.

avatar richard67
richard67 - comment - 5 Apr 2022

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.

avatar brianteeman
brianteeman - comment - 5 Apr 2022

beat me to it.

avatar richard67
richard67 - comment - 5 Apr 2022

beat me to it.

@brianteeman Means you are on it already?

avatar brianteeman
brianteeman - comment - 5 Apr 2022

I was but I stopped now

avatar richard67
richard67 - comment - 5 Apr 2022

@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.

avatar brianteeman
brianteeman - comment - 5 Apr 2022

Please test #37489

avatar richard67 richard67 - change - 5 Apr 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-04-05 09:17:17
Closed_By richard67
avatar richard67 richard67 - close - 5 Apr 2022
avatar richard67
richard67 - comment - 5 Apr 2022

Closing as having a pull request. Please test #37489 . Thanks in advance.

Add a Comment

Login with GitHub to post a comment