Unable to add pages in 5.6.3.2 - new caching values are null in page.php

Permalink
After upgrading to 5.6.3.2 I am unable to add new pages. I receive the following error:

mysqlt error: [1048: Column 'cCacheFullPageContent' cannot be null] in EXECUTE("insert into Pages (cID, cParentID, uID, cInheritPermissionsFrom, cOverrideTemplatePermissions, cInheritPermissionsFromCID, cDisplayOrder, pkgID, cCacheFullPageContent, cCacheFullPageContentOverrideLifetime, cCacheFullPageContentLifetimeCustom) values ('217', '136', '1', 'PARENT', '1', '1', 3, 0, NULL, NULL, NULL)")


After looking at concrete/core/models/page.php I see functions returning

$this->cCacheFullPageContent  // and OverrideLifetime and LifetimeCustom


*but* nothing *setting* their values.

The diff from 5.6.3.1 to 5.6.3.2 of /concrete/core/models/collection_types.php is too large to tell if something got messed up there :(

I tried asking in IRC, but didn't receive a response...

jasteele12
 
Mnkras replied on at Permalink Reply
Mnkras
There were no schema changes related to this when going from 5.6.3.1->5.6.3.2

The column should have a default value of -1, therefore never be null, can you go into phpmyadmin and see if that column has the default attribute set on it?
jasteele12 replied on at Permalink Reply
jasteele12
As I'm sure you are aware, default values only kick in when they are not explicitly set.

cCacheFullPageContent has default -1
cCacheFullPageContentOverrideLifetime has default 0
cCacheFullPageContentLifetimeCustom has default 0


But, what has changed is those values are now set in the SQL INSERT.

Again, $this-> is not set anywhere, but used - the code makes no sense to me:

https://github.com/concrete5/concrete5/commit/1f358edde8bd6fc181f810...

In any case, I am unable to add new pages...
designbordello replied on at Permalink Reply
designbordello
Thanks for the thread. It got me on the right track, I think.

I was trying to add pages of a particular type (ctID = 25) and they would fail with the same error that you noted. This is how I got there.

1. I checked my Page Types in my Dashboard. The page that I was trying to add was missing the 'Defaults' button, indicating that it couldn't find its template.

2. I checked my 'Pages' table and noted the cID values for rows with 'cIsTemplate' set to 1. These are my template pages.

3. I visited each template page (http://www.example.com/index.php?cID=122) to find the template page that I was trying to add. I noted the cID of the template page that I was trying to add. (cID = 122)

4. I checked my 'CollectionVersions' table to find cID 122 and inspect the 'ctID' value. This should have been 25 but was it incorrectly set to 11.

5. I updated ctID = 25 for the row in 'CollectionVersions' where cID = 122 and all is working again.

I suspect it was a result of me cleaning out my page types for the client.

I hope this gets you there.