Multilingual Setup leads to an error on page insert from root

Permalink 5 2 Browser Info Environment
I just played around with this:
- Load a new language which wanted a slug like /de
- Set this as default
- Delete the old default language
- Add any other language with a slug
- Delete /de
- Add de but with slug / to show as the new main Home
- Delete the other random language that was just there as a placeholder to add de without a slug
- Insert page from root using "edit mode" -> recieve Error message from DBLA that parent ID should not be empty
- See the query from Page.php#getDraftsParentPage
- Try select * from PagePaths pp inner join Pages p on pp.cID = p.cID inner join SiteLocales sl on p.siteTreeID = sl.siteTreeID where cPath = '/!drafts' and sl.siteID = 1
- Get no resault
- Look into the database table "PagePaths" ... there is indeed a row with "/!drafts"
- Check the query "select * from PagePaths pp inner join Pages p on pp.cID = p.cID inner join SiteLocales sl on p.siteTreeID = sl.siteTreeID" without a 'where' -> get an ID
- Check the ids
- Find a row in "PagePaths" where cPath is empty
- Update it with '/!drafts'
- See the thins is working again

I found serveral issues and fixes for similar problems, but I dont think they tried to change the slug in that way or something.

What generally happend was the insertions of empty string for cPath instead of /!drafts

Anywhere in the add/delete process of languages this got corrupted.
I think this could be small bug anywhere on the way - yet it leads to big impact -> Not being able to add pages to the root.

Hopefully someone can find the bug with this. Or maybe fix his/her side

The message on insert:
An exception occurred while executing 'insert into Pages (cID, siteTreeID, ptID, cParentID, uID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cInheritPermissionsFromCID, cDisplayOrder, pkgID, cIsActive, cIsDraft) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [241, null, "5", null, "1", "TEMPLATE", null, 179, 0, 0, 0, 1]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'cParentID' cannot be null


Status: New
koalasoft
okhayat replied on at Permalink Reply
okhayat
Same here
Adp replied on at Permalink Reply
Same Error message:

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

Seams to be the same error as in 2017 which was fixed here:

https://github.com/concrete5/concrete5/commit/1c5e1a11a2c266bb52d801...
Hubble replied on at Permalink Reply
Encountered the same bug while trying with a french locale.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.2
Version Installed - 8.5.2
Database Version - 20190925072210

# Database Information
Version: 10.3.21-MariaDB
SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

# concrete5 Packages
Overlay (0.0.1)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
nginx/1.15.7

# Server API
fpm-fcgi

# PHP Version
7.3.11

# PHP Extensions
apcu, bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, json, ldap, libxml, mailparse, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, soap, sockets, sodium, SPL, sqlite3, ssh2, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 3600
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 640
max_input_time - 36000
max_input_vars - 10000
memory_limit - 512M
post_max_size - 64M
upload_max_filesize - 32M
ldap.max_links - Unlimited
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
xdebug.max_nesting_level - 256
xdebug.max_stack_frames - -1
xdebug.var_display_max_children - 128
xdebug.var_display_max_data - 512
xdebug.var_display_max_depth - 3
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36