Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilanguage error #5750

Closed
danielgasser opened this issue Jul 25, 2017 · 12 comments
Closed

Multilanguage error #5750

danielgasser opened this issue Jul 25, 2017 · 12 comments
Assignees
Labels
Type:Bug Existing functionality not performing as expected.
Milestone

Comments

@danielgasser
Copy link
Contributor

danielgasser commented Jul 25, 2017

A similar issue has been adressed (and closed) already here but to me it still seems buggy. When adding a new language and switch default locale to that language, adding a new page throws an integrity constraint violation exception. How to reproduce:

  1. fresh install with content (see environment below)
  2. go to /dashboard/system/multilingual/setup and hit "Add Locale"
  3. Enter "German" & "Germany" under Choose Language & Choose Country (or any other)
  4. Under Home Page choose a Template (Full) and a Page Name (Deutsch)
  5. URL slug: de (also tried with leading/trailing slash)
  6. IMPORTANT: Default locale must be set to de_DE
  7. head over to Sitemap and add an empty page under "Deutsch" and Publish it or set it to "Edit mode"
    (doesn't matter)

Exception:

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

Stacktrace:

/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php(112): Doctrine\DBAL\Exception\NotNullConstraintViolationException->null |  
-- | --
/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException |  
/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(177): Doctrine\DBAL\DBALException->driverExceptionDuringQuery |  
/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(93): Doctrine\DBAL\Driver\PDOException->null |  
/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): PDOException->null |  
/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): PDOStatement->execute |  
/var/www/html/c82/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(168): Doctrine\DBAL\Driver\PDOStatement->execute |  
/var/www/html/c82/concrete/src/Page/Page.php(3078): Doctrine\DBAL\Statement->execute |  
/var/www/html/c82/concrete/src/Page/Type/Type.php(1164): Concrete\Core\Page\Page->add |  
/var/www/html/c82/concrete/controllers/dialog/page/add/compose.php(83): Concrete\Core\Page\Type\Type->createDraft |  
/var/www/html/c82/concrete/src/Controller/AbstractController.php(172): Concrete\Controller\Dialog\Page\Add\Compose->submit |  
/var/www/html/c82/concrete/src/Controller/AbstractController.php(172): null->call_user_func_array |  
/var/www/html/c82/concrete/src/Routing/ControllerRouteCallback.php(27): Concrete\Core\Controller\AbstractController->runAction |  
/var/www/html/c82/concrete/src/Routing/Router.php(149): Concrete\Core\Routing\ControllerRouteCallback->execute |  
/var/www/html/c82/concrete/src/Http/DefaultDispatcher.php(114): Concrete\Core\Routing\Router->execute |  
/var/www/html/c82/concrete/src/Http/DefaultDispatcher.php(54): Concrete\Core\Http\DefaultDispatcher->handleDispatch |  
/var/www/html/c82/concrete/src/Http/Middleware/DispatcherDelegate.php(39): Concrete\Core\Http\DefaultDispatcher->dispatch |  
/var/www/html/c82/concrete/src/Http/Middleware/ThumbnailMiddleware.php(60): Concrete\Core\Http\Middleware\DispatcherDelegate->next |  
/var/www/html/c82/concrete/src/Http/Middleware/MiddlewareDelegate.php(38): Concrete\Core\Http\Middleware\ThumbnailMiddleware->process |  
/var/www/html/c82/concrete/src/Http/Middleware/FrameOptionsMiddleware.php(39): Concrete\Core\Http\Middleware\MiddlewareDelegate->next |  
/var/www/html/c82/concrete/src/Http/Middleware/MiddlewareDelegate.php(38): Concrete\Core\Http\Middleware\FrameOptionsMiddleware->process |  
/var/www/html/c82/concrete/src/Http/Middleware/CookieMiddleware.php(37): Concrete\Core\Http\Middleware\MiddlewareDelegate->next |  
/var/www/html/c82/concrete/src/Http/Middleware/MiddlewareDelegate.php(38): Concrete\Core\Http\Middleware\CookieMiddleware->process |  
/var/www/html/c82/concrete/src/Http/Middleware/ApplicationMiddleware.php(29): Concrete\Core\Http\Middleware\MiddlewareDelegate->next |  
/var/www/html/c82/concrete/src/Http/Middleware/MiddlewareDelegate.php(38): Concrete\Core\Http\Middleware\ApplicationMiddleware->process |  
/var/www/html/c82/concrete/src/Http/Middleware/MiddlewareStack.php(86): Concrete\Core\Http\Middleware\MiddlewareDelegate->next |  
/var/www/html/c82/concrete/src/Http/DefaultServer.php(85): Concrete\Core\Http\Middleware\MiddlewareStack->process |  
/var/www/html/c82/concrete/src/Foundation/Runtime/Run/DefaultRunner.php(115): Concrete\Core\Http\DefaultServer->handleRequest |  
/var/www/html/c82/concrete/src/Foundation/Runtime/DefaultRuntime.php(102): Concrete\Core\Foundation\Runtime\Run\DefaultRunner->run |  
/var/www/html/c82/concrete/dispatcher.php(39): Concrete\Core\Foundation\Runtime\DefaultRuntime->run |  
/var/www/html/c82/index.php(3): null->require

Environment:

# concrete5 Version
Core Version - 8.2.0
Version Installed - 8.2.0
Database Version - 20170711151953

# concrete5 Packages
None

# concrete5 Overrides
None

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

# Server Software
Apache/2.4.18 (Ubuntu)

# Server API
apache2handler

# PHP Version
7.0.18-1+deb.sury.org~xenial+1

# PHP Extensions
apache2handler, blackfire, calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xdebug, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 256M
post_max_size - 60M
sql.safe_mode - Off
upload_max_filesize - 40M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
xdebug.max_nesting_level - 250
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 - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5
@danielgasser
Copy link
Contributor Author

danielgasser commented Jul 25, 2017

As far as I can see, the cParentID is null because the parent can't be loaded in Type/createDraft(), here: I'll investigate further and hopefully I'll get a solution for this.

@publicb
Copy link

publicb commented Jul 27, 2017

I can reproduce this issue as follows (as documented on the forums).

  1. install concrete5-8.2
  2. add new locale in multilingual setup
  3. set default locale to that new locale
  4. try to add a page

@aembler
Copy link
Member

aembler commented Aug 9, 2017

Could you check out this pull request @publicb and @danielgasser and see if this fixes the problem?

@aembler aembler added Status:Available Reviewed issue, it’s real, we’d review a pull request. priority:must have Type:Bug Existing functionality not performing as expected. labels Aug 9, 2017
@aembler aembler added this to the 8.2.2 milestone Aug 9, 2017
@danielgasser
Copy link
Contributor Author

danielgasser commented Aug 10, 2017

@aembler Yes! I can confirm that this fixes the problem on a fresh install of 8.2.0 and 8.2.1. Thank you very much!

@aembler
Copy link
Member

aembler commented Aug 10, 2017

Great!

@KorvinSzanto KorvinSzanto removed the Status:Available Reviewed issue, it’s real, we’d review a pull request. label Aug 10, 2017
@recomdesign
Copy link

How to resolve this issue?
I am currently working with C5 8.2.1 and i also get this error messages.
Even when i delete all languages i can't add pages to the website.
Please help :(

@danielgasser
Copy link
Contributor Author

danielgasser commented Oct 22, 2017

@recomdesign It's solved, use this fix: 316e955

@recomdesign
Copy link

@danielgasser Thank you, i will take a look at that.

@KuukiFi
Copy link

KuukiFi commented Nov 1, 2017

Hi @aembler! I'm having the same problem. I followed your instructions 1c5e1a1 and also tried with this:316e955 but I'm still getting an error..? Any help would appreciated.

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

@bobzepplin
Copy link

@KuukiFi ... Do you find a workaround ? still not working, after update concrete from 5.7.3...

@KuukiFi
Copy link

KuukiFi commented Dec 5, 2017

No I didn't. Our project was just about to start so I decided to install again. Now it seems to work fine as I don't need to change the locale.

@bobzepplin
Copy link

@KuukiFi & @aembler .I confirm that the fixes work with a new concrete5.8.2 install... but, however, not with an updated site from 5.7.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug Existing functionality not performing as expected.
Projects
None yet
Development

No branches or pull requests

7 participants