I can't create a page. "Attempt to read property "pThemeID" on null"

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”

I’m not sure it’s a good idea to change the theme of just one of your pages. Can you switch it back so that all of the pages are using the same theme?

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.

We used to be able to do this in earlier versions. I haven’t tested it past 5.7-ish but certainly this was a ‘feature’ of c5 in the past.

1 Like

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.

What’s the line number that it’s crashing on?

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.

error is

/src/Page/Page.php1828
    } elseif ($this->vObj->pThemeID < 1) {

Seems like the same issue discussed here and possibly in this issue or this one.

To rule out some of the related issues, is this site using the multilingual system? Is the theme documentation installed for Atomik?

Also, what’s the other theme on the site?

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.