User tests: Successful: Unsuccessful:
Pull Request resolves # .
IF for some reason your site does not have a $secret in the configuration.php and you try to see an api token then the field will be empty. This PR adds a log explaining the reason for the token to be blank
I didn't think it was possible not to have a $secret but I saw this on a live site - possibly created by a hosts own joomla creation script
Go to the Joomla Api Token of your own user account
There should be an API token displayed
Edit configuration.php and remove the line public $secret
Check your token again and it is empty
Enable logging (Log Almost Everything) in the admin
Check your token again
There is nothing in the logs
the log file everything.php now contains an explanation why the field is blank
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End Plugins |
I have tested this item ✅ successfully on 082ad0e
I have tested this item ✅ successfully on 082ad0e
I’ve set up a local test environment and, as well as carrying out manual verification, I’ve also had the AI run through everything. The result: All three code paths log as described. A few suggestions below, none of them blockers.
Tested on 6.2.0-alpha4-dev, DDEV / PHP 8.3 / MySQL, PR head 082ad0ec.
| Scenario | Config | Observed |
|---|---|---|
| Baseline | $secret set, log_everything=1 |
Token displayed in user profile, API request 200, no security entries in everything.php |
public $secret line removed |
log_everything=1 |
Token field renders value="" and everything.php gets ERROR … security … No site secret configured in configuration.php. — 1 entry per profile page load |
| API request with a token | same | 401 Forbidden + same ERROR … security … entry (this is the api-authentication/token path) |
Restored $secret |
log_everything=1 |
Token displayed again, API 200, no further security entries |
Log excerpt with the secret removed:
2026-08-08T13:55:26+00:00 ERROR 172.18.0.5 security No site secret configured in configuration.php.
2026-08-08T13:57:05+00:00 ERROR 172.18.0.5 security No site secret configured in configuration.php.
2026-08-08T13:57:05+00:00 INFO 172.18.0.5 tokenfailure Authentication failed
Other checks:
grep confirms these are the only three empty($siteSecret) sites in the tokenJoomlatokenField::getTokenForDisplay()empty($tokenSeed) and only one line is written per page load.ruleset.xml) is clean on both plugins.1. The category security makes the message invisible in a default configuration.
This is the main one. CMSApplication::setupLogging() only registers loggers for deprecated,
system and — if log_everything is on — everything else. I re-ran the test with the default
logging config (no log_everything, no log_categories) and no log file was written at all. So the
message only reaches someone who has already enabled "Log Almost Everything" — i.e. someone who
already suspects a problem, whereas the person hitting this bug just sees a blank field.
Category system at Log::ERROR is written to joomla_core_errors.php unconditionally
(Log::addLogger(['text_file' => 'joomla_core_errors.php'], Log::ERROR|…, ['system'])). I verified
this — with the category swapped and no configuration change at all:
2026-08-08T14:10:11+00:00 ERROR 172.18.0.5 system No site secret configured in configuration.php.
2. Use an import instead of the inline FQCN. 89 core files do use Joomla\CMS\Log\Log;; the only
inline \Joomla\CMS\Log\Log:: uses in core are libraries/bootstrap.php / libraries/cms.php,
where the autoloader isn't available yet. phpcs doesn't flag it, but it's off-convention:
use Joomla\CMS\Log\Log;
…
Log::add('…', Log::ERROR, 'system');3. Consider a language string. 219 of ~324 Log::add() calls in core use Text::, and the one
existing security-category log in core does too
(plugins/authentication/cookie → Text::sprintf('PLG_AUTHENTICATION_COOKIE_ERROR_LOG_LOGIN_FAILED', …)).
4. The message is identical in all three places, so the log doesn't say which subsystem produced
it, and it states the cause but not the effect. Since the stated goal is "explaining the reason for
the token to be blank", something like "No site secret configured in configuration.php — the API
token cannot be generated/verified" plus the plugin name would be more actionable.
5. Small inconsistency in api-authentication/token: the try { … } catch (\Exception) { return; }
around get('secret') returns without logging, while the two user/token files set $siteSecret = ''
and then fall through to the logged branch. Same root cause, different observability.
6. Branch target: the surrounding code is identical in 5.4-dev. If this counts as a diagnostic
fix rather than a feature it would apply cleanly there too — your call.
plg_user_token + plg_api_authentication_token, open your own user account in the admin,public $secret line from configuration.php.administrator/logs/everything.phpERROR … security … line. An API request with X-Joomla-Token produces the401.Please consider implementing the following:
2. Use an import instead of the inline FQCN. 89 core files do use Joomla\CMS\Log\Log;; the only
inline \Joomla\CMS\Log\Log:: uses in core are libraries/bootstrap.php / libraries/cms.php,
where the autoloader isn't available yet. phpcs doesn't flag it, but it's off-convention:
@QuyTon based on @HLeithner dismissal of this I wont be wasting any more time on it until a maintainer makes a final decision
@QuyTon based on @HLeithner dismissal of this in #48275 I wont be wasting any more time on it until a maintainer makes a final decision
I have tested this item ✅ successfully on 082ad0e
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48198.