I need help.
This error occurs when I create a page.
“Attempt to read property “pThemeID” on null”
I was able to create pages up until now, but I think this error started appearing after I changed the theme of one of my pages to “Atomik”.
I’m using a theme purchased from the marketplace.
Concrete Version Core Version - 9.3.8
PHP Version 8.2.22
error log is
/public_html/updates/concrete-cms-9.3.8-remote-updater/concrete/src/Page/Page.php
*/
public function getCollectionThemeObject()
{
if (!isset($this->themeObject)) {
$app = Facade::getFacadeApplication();
$tmpTheme = $app->make(ThemeRouteCollection::class)
->getThemeByRoute($this->getCollectionPath());
if (isset($tmpTheme[0])) {
switch ($tmpTheme[0]) {
case VIEW_CORE_THEME:
$this->themeObject = new \Concrete\Theme\Concrete\PageTheme();
break;
case 'dashboard':
$this->themeObject = new \Concrete\Theme\Dashboard\PageTheme();
break;
default:
$this->themeObject = PageTheme::getByHandle($tmpTheme[0]);
break;
}
} elseif ($this->vObj->pThemeID < 1) {
$this->themeObject = PageTheme::getSiteTheme();
} else {
$this->themeObject = PageTheme::getByID($this->vObj->pThemeID);
}
}
if (!$this->themeObject) {
$this->themeObject = PageTheme::getSiteTheme();
}
return $this->themeObject;
}
/**
* Get the page name.
*
* @return string
*/
public function getCollectionName()
{
$customAliasName = (string) $this->getCustomAliasName();
Arguments
“Attempt to read property “pThemeID” on null”
Thanks for your comment.
I changed the theme of one page to “Atomic” to test an add-on.
The add-on didn’t work with the site theme, so I changed the theme of one page.
I’ve now deleted that page and haven’t changed the site theme, but I’m still getting this error.
I was able to add pages up until one day ago.
I haven’t made any major changes like updating the core.
I only made a temporary theme change to one page.
Not being able to add pages is a fatal situation.
I still get an error even after “disabling then enabling” the site theme.
I wonder if I can fix this by changing a configuration setting somewhere.
yeah, I guess that’s true. I just guessed it might have been the source of the problem based on the error. Theoretically it should be possible, but somehow the new pages here don’t know which theme to use.
Myq.
Thanks for the investigation.
I’ve seen this issue too.
I don’t think any of it applies.
There’s no multilingual or Atomic documentation settings.
When I try to delete Atomic, I get a warning that the core theme cannot be deleted.
The theme I’m currently using is RepricaPro, and I’ve contacted the author.
It’s been resolved.
The drafts folder had been moved into the stacks folder.
Once I moved it out of there, I was able to add pages.
However, I don’t know why the drafts folder was moved to the stacks folder. I don’t think I ever moved it.
I’d like some additional advice on this.
I would like to move the drafts folder directly under the root, but it seems I can’t do this manually. It seems I can only move it under an existing folder.
Is there a setting for this somewhere?
That’s a good (and probably the only) solution. I asked around and couldn’t find a way to do it through the UI, unfortunately. I’ve made a ticket to see if we can prevent someone from getting in this situation in the future though!