No Code Attached Yet bug
avatar brianteeman
brianteeman
18 Aug 2026

What happened?

since the merge of #48030

if for some reason you do not have a $secret in your configuration.php

0 Joomla\Component\Content\Administrator\Service\PreviewTokenService::__construct(): Argument #1 ($secret) must be of type string, null given, called in C:\repos\j62\administrator\components\com_content\src\View\Article\HtmlView.php on line 97


 | Function | Location
-- | -- | --
1 | () | JROOT\administrator\components\com_content\src\Service\PreviewTokenService.php:45
2 | Joomla\Component\Content\Administrator\Service\PreviewTokenService->__construct() | JROOT\administrator\components\com_content\src\View\Article\HtmlView.php:97
3 | Joomla\Component\Content\Administrator\View\Article\HtmlView->initializeView() | JROOT\libraries\src\MVC\View\FormView.php:179
4 | Joomla\CMS\MVC\View\FormView->display() | JROOT\libraries\src\MVC\Controller\BaseController.php:705
5 | Joomla\CMS\MVC\Controller\BaseController->display() | JROOT\administrator\components\com_content\src\Controller\DisplayController.php:70
6 | Joomla\Component\Content\Administrator\Controller\DisplayController->display() | JROOT\libraries\src\MVC\Controller\BaseController.php:738
7 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143
8 | Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() | JROOT\libraries\src\Component\ComponentHelper.php:361
9 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT\libraries\src\Application\AdministratorApplication.php:150
10 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT\libraries\src\Application\AdministratorApplication.php:206
11 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT\libraries\src\Application\CMSApplication.php:320
12 | Joomla\CMS\Application\CMSApplication->execute() | JROOT\administrator\includes\app.php:58
13 | require_once() | JROOT\administrator\index.php:32

Version

6.2

Expected result

No response

Actual result

No response

System Information

No response

Additional Comments

No response

avatar brianteeman brianteeman - open - 18 Aug 2026
avatar brianteeman brianteeman - change - 18 Aug 2026
Labels Added: bug
avatar brianteeman brianteeman - labeled - 18 Aug 2026
avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Aug 2026
avatar brianteeman brianteeman - change - 18 Aug 2026
The description was changed
avatar brianteeman brianteeman - edited - 18 Aug 2026
avatar brianteeman
brianteeman - comment - 18 Aug 2026

closing for now as I cant reproduce it on a clean install

avatar brianteeman brianteeman - change - 18 Aug 2026
Status New ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-08-18 17:29:50
Closed_By ⇒ brianteeman
avatar brianteeman brianteeman - close - 18 Aug 2026
avatar joomdonation
joomdonation - comment - 19 Aug 2026

Look like the on your site, $secret is lost in configuration.php (which should not under normal condition) and it causes the issue. Will need to check to see what we should do to prevent error for this special case.

avatar brianteeman brianteeman - change - 19 Aug 2026
Status Closed ⇒ New
Closed_Date 2026-08-18 17:29:50 ⇒
Closed_By brianteeman ⇒
avatar brianteeman brianteeman - reopen - 19 Aug 2026
avatar brianteeman
brianteeman - comment - 19 Aug 2026

yes that is exactly what happened. I remembered too late that I had removed the $secret from configuration.php when I was writing this PR #48198

Up until this PR not having a $secret only caused a problem when you tried to create an api key.

Not having a $secret is something I came across on a client site that I believe was created from a hosting providers only installer. For the specific error I was addressing in #48198 I found a few similar reports so its obviously not a one off situation.

So I am reopening this (with an updated first post) as I believe it is something we should be able to give a specific error message for that is more helpful than the current bug display as shown in the first post.

avatar brianteeman brianteeman - change - 19 Aug 2026
The description was changed
avatar brianteeman brianteeman - edited - 19 Aug 2026
avatar brianteeman
brianteeman - comment - 19 Aug 2026

@joomdonation had a go at a draft pr for this #48275

avatar brianteeman brianteeman - change - 3 Nov 2026
Status New ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-11-03 23:03:23
Closed_By ⇒ brianteeman
avatar brianteeman brianteeman - close - 3 Nov 2026
avatar brianteeman
brianteeman - comment - 3 Nov 2026

closing since 48030 was reverted

Add a Comment

Login with GitHub to post a comment