Missing sitetree, can't create Global Stacks

Permalink
**************** SOLLUTION USE THIS ***************

Don't delete or change current locale. Just edit default language HOME -> SEO -> URL Slug, example change it to /en/

***************************************************************

It seems that my site don't have anymore root sitetree.

Site is multilangual (8 languages) and it seemed to work correctly. I wanted that all languages are in own "directories" so "What I did was change the default language to another, then delete original language and then created that again. No it seems to work, but let's if whole site goes down with flames..." (https://www.concrete5.org/community/forums/internationalization/how-to-change-the-default-locale-pathurl/#882334)

And then flames came. When I try to greate global stacks I got message "Call to a member function getSiteTreeID() on null"

And log message is:
Exception Occurred: xxx/concrete/src/Page/Stack/Stack.php:178 Call to a member function getSiteTreeID() on null (0)

So line 178 is: $siteTreeID = $parent->getSiteTreeObject()->getSiteTreeID();

That $parent page siteTreeID is 1 whitch not exist anymore. So how can I create root sitetree again?

That $parent collectionID is 150 which is not shown anymore in full sitemap. I guess it was that deleted original language root page.

I tried to create new row in SiteTrees (1, 1, sitetree) and I did't get error message anymore. But when I create new Global Stack it is not shown in list. And still get some error messages and those created block are not listed in "Stacks & Global Areas".


So how can I create new site root or update site so, that global blocks work again?

If you want test that situation, here is how you can do it:
1) install concrete5 (8.1)
2) add new locale in multilangual setup
3) set default locale to that new locale
4) delete that original locale
5) create new locale
6 try to create new global stack

EDIT: If you want to do test, remove global blocks from default theme "element". Global blocks don't work if you change default local.

EDIT2:https://www.concrete5.org/developers/bugs/8-1-0/multilingual-default...

 
jruutu replied on at Permalink Reply
I tried to create test site, but it doesn't work. When try to create new page, I get error,

An unexpected error occurred:
An exception occurred while executing 'insert into Pages (cID, siteTreeID, ptID, cParentID, uID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cInheritPermissionsFromCID, cDisplayOrder, pkgID, cIsActive) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["170", null, "1", null, "1", "TEMPLATE", null, null, 0, 0, 1]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'cParentID' cannot be null

So what I did was create new locale, add page to it, set that locale as default, delete old/original locale and tried to create page.

Original site is currently working 8 languages, 50+ pages/language.