CollectionVersionBlockStyles Error :'(

Permalink
Wonder if anyone can help, I was currently trying to update a website page on concrete5 but it has a slight issue, when i add new content and save it, it will save my changes BUT also clear all the original content already on that page off!!

It is quite annoying as you can imagine :)

Before it does this it displays the following error...



Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1062: Duplicate entry '117-90' for key 1] in EXECUTE("insert into CollectionVersionBlockStyles (cID, cvID, bID, arHandle, csrID) values ('90', '9', '117', 'Header Image', 0)") ' in D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php:78 Stack trace: #0 D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 1062, 'Duplicate entry...', 'insert into Col...', false, Object(ADODB_mysql)) #1 D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb.inc.php(993): ADOConnection->_Execute('insert into Col...') #2 [internal function]: ADOConnection->Execute('insert into Col...', Array) #3 D:\Moorfields Recovery\concrete\libraries\database.php(73): call_user_func_array(Array, Array) #4 D:\Moorfields Recovery\concrete\models\block.php(404): Database->__call('Execute', Array) #5 D:\Moorfields Recovery\concrete\models\block.php(404): Database->Execute('insert into Col...' in D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php on line 78



I have gone into the SQL Query Browser and tried to EXECUTE the following as the errors says...

insert into CollectionVersionBlockStyles (cID, cvID, bID, arHandle, csrID) values ('90', '9', '117', 'Header Image', 0)

When I click 'Execute' it displays that my query could not be executed with the discription of "Duplicate entry '117-90' for key 1"

I can't say im a expert at SQL but i will give it a go :)

All help will be a MASSIVE help ;)

Cheers,
Chris

ChrisWatterston
 
Mnkras replied on at Permalink Reply
Mnkras
go to the CollectionVersionBlockStyles table,

find
('90', '9', '117', 'Header Image', 0)
delete it

backup your db first ;)
ChrisWatterston replied on at Permalink Reply
ChrisWatterston
I tried out the mentioned above but it didn't work....well it did untill i went back into the page to re-edit it...then it through exacly the same error?

I have just create a fresh new page to see if it does the same on that, it did but displayed this error....

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1062: Duplicate entry '672-105' for key 1] in EXECUTE("insert into CollectionVersionBlockStyles (cID, cvID, bID, arHandle, csrID) values ('105', '5', '672', 'Header Image', '0')") ' in D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php:78 Stack trace: #0 D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 1062, 'Duplicate entry...', 'insert into Col...', false, Object(ADODB_mysql)) #1 D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb.inc.php(993): ADOConnection->_Execute('insert into Col...') #2 [internal function]: ADOConnection->Execute('insert into Col...', Array) #3 D:\Moorfields Recovery\concrete\libraries\database.php(73): call_user_func_array(Array, Array) #4 D:\Moorfields Recovery\concrete\models\block.php(404): Database->__call('Execute', Array) #5 D:\Moorfields Recovery\concrete\models\block.php(404): Database->Execute('insert into Col in D:\Moorfields Recovery\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php on line 78


Serious advice would be great as the last thing I would like to do it rebuild the WHOLE website :'(

Cheers
tbcrowe replied on at Permalink Reply
tbcrowe
If this is still a problem, please PM me. I had the same problem with a site and came up with a code change to work around the problem.
darryloctober replied on at Permalink Reply
I am having exactly the same problem. Mine is Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1062: Duplicate entry '10-1' for key 'PRIMARY'] in EXECUTE("insert into CollectionVersionBlockStyles (cID, cvID, bID, arHandle, csrID) values ('1', '110', '10', 'Main', '0')")

When I remove all records in this table which have cID = 1, I am able to edit, for example a content block, and hit save, but when I exit edit mode, save my changes, then enter edit mode again and try to update a block on the page, I get the same message coming back again. The DB now has repopulated all the offending original cID = 1 rows back again. I have to go to versions and remove the latest version which is basically a blank page in my theme without any blocks on it. Any suggestions would be much appreciated! Thanks, Darryl.

My environment:

# concrete5 Version
5.4.1.1

# concrete5 Packages
Blog (1.2.3.8), Cu3er Slideshow (1.1.6), Facebook Like Button (1.1), Galleria image gallery (2.0), Mobile Theme Switcher (1.0), Next & Previous (1.02), Print Page (1.4), Social Icons (1.1), Tag Cloud (1.0.2), Thumbview Template (1.1.1), Zoom Image (1.0).

# concrete5 Overrides
themes/s8_express

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.3.3

# PHP Extensions
apache2handler, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, ionCube Loader, json, libxml, mbstring, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, Reflection, session, shmop, SimpleXML, sockets, SPL, SQLite, standard, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# PHP Settings
log_errors_max_len - 1024
max_execution_time - 5
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 10M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 100000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH
darryloctober replied on at Permalink Reply
Hi, what was your code work around for this in the end? Did you find out the cause of this problem? Your help would be much appreciated, thanks, Darryl.
ChrisWatterston replied on at Permalink Reply
ChrisWatterston
Hi Darryl,

Not 100% sure but I believe I ended up rebuilding the website :'(
Sorry I couldn't supply a fix.

Thanks,
Chris Watterston