Publisher does not support the Fluid field type. Please do not contact asking when support will be available.
If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.
Ticket: Error When Trying To Access Bloqs Settings and Edit Pages Containing Bloqs
Status | Resolved |
Add-on / Version | Bloqs 4.9.0 |
Severity | |
EE Version | 6.0.6 |
Michael Coogan
Oct 12, 2021I updated from EE 3.5.4 and Bloqs 3.1.0.
Error when trying to access settings:
Exception Caught
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c.componentdefinition_id' in 'field list':
SELECT DISTINCT c.blockdefinition_id as 'bd_id', c.componentdefinition_id as 'c_id' FROM exp_blocks_components AS c JOIN exp_blocks_blockdefinition AS bd ON bd.id = c.componentdefinition_id AND bd.id != c.blockdefinition_id
ee/legacy/database/drivers/mysqli/mysqli_connection.php:114
Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('SELECT DISTINCT…')
#1 ee/legacy/database/DB_driver.php(260): CI_DB_mysqli_driver->_execute('SELECT DISTINCT…')
#2 ee/legacy/database/DB_driver.php(175): CI_DB_driver->simple_query('SELECT DISTINCT…')
#3 user/addons/bloqs/Database/Adapter.php(1679): CI_DB_driver->query('SELECT DISTINCT…')
#4 user/addons/bloqs/Database/Adapter.php(682): BoldMinded\Bloqs\Database\Adapter->query('SELECT DISTINCT…')
#5 user/addons/bloqs/mcp.bloqs.php(194): BoldMinded\Bloqs\Database\Adapter->getBlocksUsedInComponents()
#6 [internal function]: Bloqs_mcp->index()
#7 ee/ExpressionEngine/Controller/Addons/Addons.php(1397): call_user_func_array(Array, Array)
#8 ee/ExpressionEngine/Controller/Addons/Addons.php(701): ExpressionEngine\Controller\Addons\Addons->getModuleSettings('bloqs', 'index', Array)
#9 [internal function]: ExpressionEngine\Controller\Addons\Addons->settings('bloqs')
#10 ee/ExpressionEngine/Core/Core.php(251): call_user_func_array(Array, Array)
#11 ee/ExpressionEngine/Core/Core.php(111): ExpressionEngine\Core\Core->runController(Array)
#12 ee/ExpressionEngine/Boot/boot.php(161): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#13 public_html/manage.php(144): require_once('...')
#13 public_html/manage.php(144): require_once('...')
Error when trying to edit pages with bloqs:
Exception Caught
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b.componentdefinition_id' in 'field list':
SELECT bd.id as bd_id, bd.group_id as bd_group_id, bd.shortname as bd_shortname, bd.name as bd_name, bd.instructions as bd_instructions, bd.deprecated as bd_deprecated, bd.deprecated_note as bd_deprecated_note, bd.preview_image as bd_preview_image, bd.preview_icon as bd_preview_icon, bd.settings as bd_settings, bd.is_component as bd_is_component, bd.is_editable as bd_is_editable, b.id as b_id, b.order as b_order, b.parent_id as b_parent_id, b.depth as b_depth, b.lft as b_lft, b.rgt as b_rgt, b.componentdefinition_id as b_componentdefinition_id, ad.id as ad_id, ad.shortname as ad_shortname, ad.name as ad_name, ad.instructions as ad_instructions, ad.order as ad_order, ad.type as ad_type, ad.settings as ad_settings, a.id as a_id FROM exp_blocks_components b LEFT JOIN exp_blocks_blockdefinition bd ON b.blockdefinition_id = bd.id LEFT JOIN exp_blocks_atomdefinition ad ON ad.blockdefinition_id = bd.id LEFT JOIN exp_blocks_atom a ON a.block_id = b.id AND a.atomdefinition_id = ad.id LEFT JOIN exp_blocks_blockgroup bg ON bd.group_id = bg.id WHERE b.componentdefinition_id = 2 ORDER BY b.order, ad.order
ee/legacy/database/drivers/mysqli/mysqli_connection.php:114
Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('SELECT\n bd.i…')
#1 ee/legacy/database/DB_driver.php(260): CI_DB_mysqli_driver->_execute('SELECT\n bd.i…')
#2 ee/legacy/database/DB_driver.php(175): CI_DB_driver->simple_query('SELECT\n bd.i…')
#3 user/addons/bloqs/Database/Adapter.php(1679): CI_DB_driver->query('SELECT\n bd.i…')
#4 user/addons/bloqs/Database/Adapter.php(1593): BoldMinded\Bloqs\Database\Adapter->query('SELECT\n bd.i…', Array)
#5 user/addons/bloqs/Database/Adapter.php(161): BoldMinded\Bloqs\Database\Adapter->getBlocksInComponent(2)
#6 user/addons/bloqs/ft.bloqs.php(290): BoldMinded\Bloqs\Database\Adapter->getBlocks(182, 36)
#7 ee/legacy/fieldtypes/EE_Fieldtype.php(320): Bloqs_ft->display_field(' ')
#8 ee/legacy/libraries/api/Api_channel_fields.php(377): EE_Fieldtype->display_publish_field(' ')
#9 ee/ExpressionEngine/Model/Content/FieldFacade.php(250): Api_channel_fields->apply('display_publish…', Array)
#10 ee/ExpressionEngine/Model/Content/Display/FieldDisplay.php(70): ExpressionEngine\Model\Content\FieldFacade->getForm()
#11 ee/ExpressionEngine/View/publish/partials/publish_form.php(83): ExpressionEngine\Model\Content\Display\FieldDisplay->getForm()
#12 ee/ExpressionEngine/Service/View/View.php(137): include('...')
#13 ee/ExpressionEngine/Service/View/View.php(106): ExpressionEngine\Service\View\View->parse('...', Array)
#14 ee/ExpressionEngine/Service/View/View.php(165): ExpressionEngine\Service\View\View->render(Array)
#15 ee/ExpressionEngine/View/publish/entry.php(5): ExpressionEngine\Service\View\View->embed(Object(ExpressionEngine\Service\View\View))
#16 ee/ExpressionEngine/Service/View/View.php(137): include('...')
#17 ee/ExpressionEngine/Service/View/View.php(106): ExpressionEngine\Service\View\View->parse('...', Array)
#18 ee/legacy/libraries/View.php(40): ExpressionEngine\Service\View\View->render(Array)
#19 ee/legacy/libraries/Cp.php(319): View->render('publish/entry', Array, false)
#20 ee/ExpressionEngine/Controller/Publish/Edit.php(530): Cp->render('publish/entry', Array)
#21 [internal function]: ExpressionEngine\Controller\Publish\Edit->entry('182')
#22 ee/ExpressionEngine/Core/Core.php(251): call_user_func_array(Array, Array)
#23 ee/ExpressionEngine/Core/Core.php(111): ExpressionEngine\Core\Core->runController(Array)
#24 ee/ExpressionEngine/Boot/boot.php(161): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#25 public_html/manage.php(144): require_once('...')
#25 public_html/manage.php(144): require_once('...')
BoldMinded (Brian)
Hi Michael. If you’re using 4.9 this should have been fixed. Are you sure the upgrade process completed without error?
BoldMinded (Brian)
And the old Bloqs addon folder is not renamed to bloqs_backup or anything? All the files from 4.9 replaced the old version?
Jelle Dijkstra
Hi Brian, I’m experiencing the same issue on my EE 5.4.2 install
BoldMinded (Brian)
Jelle, can you provide the stack trace you’re receiving? Are you on 5.4.2 and upgrading EE? What version of Bloqs do you currently have and I assume you’re trying to upgrade to 4.9?
BoldMinded (Brian)
If you’re getting this error it indicates to me that the 4.8 upgrade process didn’t execute successfully. Did either of you encounter issues when upgrading?
Jelle Dijkstra
Hi Brian, I’ve got a site that i’m preparing to go to EE6, which is on 5.4.2 at the moment. My bloqs version is currently 4.5.1. My stack trace is the same as the one above. Happy to provide you with a fresh one (though i just rolled back everything 😉 I tried it a week or so ago with the bloqs 4.8.1 version, now with the 4.9.0 version it still happens No other issues i’ve seen
BoldMinded (Brian)
I fired up my EE 5 environment, rolled Bloqs back to version 4.5.0, ran an upgrade to 4.6.0, and then to 4.9.0, and it went fine, all the database tables updated successfully. 4.6.0 is where the tables it can’t find are introduced to the schema. I then rolled back to 4.5.0, and upgraded straight to 4.9.0 and it too upgraded successfully. I’m not sure under what conditions you two are running into in which the componentdefinition_id column is not present in the exp_blocks_block table. When 4.6.0 is installed it creates the templatedefinition_id column, which is renamed to componentdefinition_id in the 4.8.0 upgrade. When I was executing the upgrade I watched the column get created, and then renamed.
Run each of these queries on your database, and then paste the results here.
Each query will result in something like this:
Jelle Dijkstra
I’m not much of an sql wizzard, so when i ran the queries i got success messages such as this
exp_blocks_atom CREATE TABLE
exp_blocks_atom
(id
bigint(20)…seems like the tables are created properly this way
BoldMinded (Brian)
The tables are already there, those queries don’t create anything, they just show the syntax used if you were to create the tables based off their current schema, so the full output will tell me what the schema is for your tables right now, and if they are correct.
Run each query one at a time, and it looks like you copied the abbreviated output… I’ll need the entire output for each.
Dave de Bruin
Comment has been marked private.
BoldMinded (Brian)
And you’re 100% sure you clicked the run update button for Bloqs? And Bloqs is now displaying as version 4.9.0 on the add-ons page?
Jelle Dijkstra
exp_blocks_atom CREATE TABLE
exp_blocks_atom
(id
bigint(20) NOT NULL AUTO_INCREMENT,block_id
bigint(20) NOT NULL,atomdefinition_id
bigint(20) NOT NULL,data
longtext COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (id
), UNIQUE KEYuk_blocks_atom_blockid_atomdefinitionid
(block_id
,atomdefinition_id
), KEYfk_blocks_atom_block
(atomdefinition_id
) ) ENGINE=InnoDB AUTO_INCREMENT=3337 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciexp_blocks_atomdefinition CREATE TABLE
exp_blocks_atomdefinition
(id
bigint(20) NOT NULL AUTO_INCREMENT,blockdefinition_id
bigint(20) NOT NULL,shortname
tinytext COLLATE utf8mb4_unicode_ci NOT NULL,name
text COLLATE utf8mb4_unicode_ci NOT NULL,instructions
text COLLATE utf8mb4_unicode_ci NOT NULL,order
int(11) NOT NULL,type
varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,settings
text COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (id
), KEYfk_blocks_atomdefinition_blockdefinition
(blockdefinition_id
) ) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciexp_blocks_block CREATE TABLE
exp_blocks_block
(id
bigint(20) NOT NULL AUTO_INCREMENT,blockdefinition_id
bigint(20) NOT NULL,entry_id
int(11) NOT NULL,field_id
int(6) NOT NULL,order
int(11) NOT NULL DEFAULT 0,parent_id
int(11) DEFAULT 0,draft
int(1) DEFAULT 0,depth
int(11) DEFAULT 0,lft
int(11) DEFAULT 0,rgt
int(11) DEFAULT 0,componentdefinition_id
int(11) NOT NULL, PRIMARY KEY (id
), KEYfk_blocks_blockdefinition_block
(blockdefinition_id
), KEYix_blocks_block_siteid_entryid_fieldid
(entry_id
,field_id
) ) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciexp_blocks_blockdefinition CREATE TABLE
exp_blocks_blockdefinition
(id
bigint(20) NOT NULL AUTO_INCREMENT,group_id
int(10) DEFAULT 0,shortname
tinytext COLLATE utf8mb4_unicode_ci NOT NULL,name
text COLLATE utf8mb4_unicode_ci NOT NULL,instructions
text COLLATE utf8mb4_unicode_ci DEFAULT NULL,settings
text COLLATE utf8mb4_unicode_ci DEFAULT NULL,preview_image
text COLLATE utf8mb4_unicode_ci DEFAULT NULL,preview_icon
text COLLATE utf8mb4_unicode_ci DEFAULT NULL,deprecated
int(1) NOT NULL DEFAULT 0,deprecated_note
text COLLATE utf8mb4_unicode_ci DEFAULT NULL,is_hidden
int(1) NOT NULL DEFAULT 0,is_editable
int(1) NOT NULL DEFAULT 0,is_component
int(1) NOT NULL DEFAULT 0, PRIMARY KEY (id
) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciexp_blocks_blockfieldusage CREATE TABLE
exp_blocks_blockfieldusage
(id
int(20) NOT NULL AUTO_INCREMENT,field_id
int(6) NOT NULL,blockdefinition_id
bigint(20) NOT NULL,order
int(11) DEFAULT NULL, PRIMARY KEY (id
), UNIQUE KEYuk_blocks_blockfieldusage_fieldid_blockdefinitionid
(field_id
,blockdefinition_id
) ) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciexp_blocks_blockgroup CREATE TABLE
exp_blocks_blockgroup
(id
int(20) NOT NULL AUTO_INCREMENT,order
int(11) NOT NULL DEFAULT 0,name
text COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (id
) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciexp_blocks_components CREATE TABLE
exp_blocks_components
(id
bigint(20) NOT NULL AUTO_INCREMENT,blockdefinition_id
bigint(20) NOT NULL,componentdefinition_id
int(11) NOT NULL,order
int(11) NOT NULL DEFAULT 0,parent_id
int(11) NOT NULL DEFAULT 0,depth
int(11) NOT NULL DEFAULT 0,lft
int(11) NOT NULL DEFAULT 0,rgt
int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id
) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ciJelle Dijkstra
oh hang on! that was not the right site! Doing 3 at once so got a bit confused
Dave de Bruin
Yes, Im sure, the tab next installed said Update, I proceded from there.
Jelle Dijkstra
Dave de Bruin
Yes, Im sure, the tab next installed said Update, I proceded from there.
Dave de Bruin
I get the same results as Jelle when I run the queries your suggested
BoldMinded (Brian)
What version of MySQL are you all running? This isn’t making any sense. I’ve upgraded my dev sites and a production site with the same update routine and they all worked. Based on your error messages, and the create tables queries in comment #15, the first query here did not work, but the other two did, and no error messages were thrown. This is the part I’m confused about. In the blocks_components table the templatedefinition_id column still exists, but it should have been renamed to componentdefinition_id. The following query which is identical, but on a different table worked fine, as well as the renaming of the table itself.
BoldMinded (Brian)
Jelle, so the upgrade worked on one site but not another? In the first sql dump you shared the exp_blocks_components table does have the componentdefinition_id column name, but in the 2nd sql dump it does not. What is the difference between the 2 sites?
Dave de Bruin
I’m on a 10.5.12-MariaDB
Jelle Dijkstra
@brian the first dump is a new site that i started on EE6 with - i believe - 4.8.1 The second one is an update from a fresh build ast year, which is using 4.5.1 from what is see it’s Server: Localhost via UNIX socket Servertype: MySQL Serververbinding: SSL wordt niet gebruikt Documentatie Serverversie: 5.7.35 - MySQL Community Server (GPL) Protocolversie: 10 Gebruiker: cpses_hewd6b8d44@localhost Karakterset van server: cp1252 West European (latin1) Webserver cpsrvd 11.98.0.8 Cliëntversie van database: libmysql - 5.6.43 PHP-uitbreiding: mysqliDocumentatie curlDocumentatie mbstringDocumentatie PHP-versie: 7.3.30
Jelle Dijkstra
that’s what phpmyadmin says. phpinfo suggests php7.4.24
BoldMinded (Brian)
Are any of you able to package up your site with a full sql dump of the database so that I can take a closer look at this locally? If so, just the necessary files to run the site (I don’t need any front-end assets), and a CP super admin login.
Jelle Dijkstra
sent you an email!
Dave de Bruin
Great! Keep me posted over here please.
BoldMinded (Brian)
Jelle it looks like you just sent an sql dump. I’m going to need an entire site folder, EE and everything, so I can setup docker container and run it locally and step debug this.
BoldMinded (Brian)
By “front-end assets” I meant images, css, and js files, but I do need the ee system folder, htaccess, index files etc.
BoldMinded (Brian)
Just to re-iterate, if anyone can provide a copy of the site, I need it in the pre-upgraded state - older version of Bloqs prior to 4.6.
Dave de Bruin
Hi Brian,
I sent you an e-mail with a link from Dropbox for the files and DB an login.
BoldMinded (Brian)
Got it, thanks!
Jelle Dijkstra
Comment has been marked private.
BoldMinded (Brian)
Dave, there are a lot of missing files… the config/constants.php, Boot/boot.common.php… Getting lots of errors so I can’t run the site.
BoldMinded (Brian)
Jelle, what is a user/pass I can use to login to the CP?
Dave de Bruin
Maybe Dropbox was still synchronizing?
Jelle Dijkstra
Comment has been marked private.
Jelle Dijkstra
oh yeah the db is in the cache folder
BoldMinded (Brian)
Emailing each of you a new build.
BoldMinded (Brian)
Posted in the other ticket:
I think I know what the issue is and will have a fix today. Apparently EE’s database smart forge class caches the existing tables for the entire request, and since you’re updating from a specific version that does not have the exp_blocks_template table yet, it is not in the cache, so when it tries to modify the column name it fails b/c it thinks the table does not exist.
(╯°□°)╯︵ ┻━┻
BoldMinded (Brian)
Comment has been marked private.
Dave de Bruin
Hi Brian,
Thanks for the update, It worked for me.
Best Dave
BoldMinded (Brian)
Marking this resolved with the 4.9.1 release. Thanks everyone for your help and providing access to your sites so I could diagnose the issue.