Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The introduction of the _ctools_block_load_blocks()
function in 1.2, and more likely the code behind that function being introduced, means that you can no longer have Views define a block without having the block module enabled as the query in that function expects the block table to be present.
Ideally, the function should check if the block module is enabled before the query is executed.
Comment | File | Size | Author |
---|---|---|---|
#17 | blocks_dependency_issue-1754770-17.patch | 2 KB | Deciphered |
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedPatch.
Comment #2
gaas CreditAttribution: gaas commentedI ran into this issue on our site. It broke we when upgrading to ctools-1.2 because it tried to select from the non-existing
blocks
table. Applied this patch and it now works.Comment #3
populist CreditAttribution: populist commentedI ran into this same problem and tested out this patch. Works great for me and seems reasonable (i.e. check to see if a module exists before querying its table).
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedThis patch shouldn't alternately invoke hook_block_info -- CTools will already be doing that. Doing so is simply wasteful. If block.module isn't enabled, it simply shouldn't execute the query. It should be able to continue just fine without that query.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedTry this simpler patch instead.
Comment #6
Deciphered CreditAttribution: Deciphered commented@merlinofchaos,
Updated, simpler patch doesn't work, whereas mine did. The new patch gives me a bunch of errors, as such:
Basically the functions are expecting populated blocks, which I provided with a simulated alternative to the query. Open to other suggestions for the fix though.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedDeciphered: Are you running the latest -dev? Because the errors you are seeing look like they'd only show up prior to http://drupalcode.org/project/ctools.git/commitdiff/03f10455c9ca38c152b3...
Comment #8
Deciphered CreditAttribution: Deciphered commentedNo, that was using the patch against CTools 1.2, which is my preferred method when dealing with bugs in stable releases, easy to manage in a makefile than using a commit, however for the purposes of testing this issue I should absolutely have been using the latest dev.
I have updated to the dev and using this patch, it seems to work fine. Apologies for the confusion.
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed. Thanks for the testing!
Comment #11
lpalgarvio CreditAttribution: lpalgarvio commentedthis bug, or similar, seems to have resurfaced.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'care4it.dpl_block' doesn't exist: SELECT b.* FROM {block} b WHERE (b.theme = :db_condition_placeholder_0) ORDER BY b.region ASC, b.weight ASC, b.module ASC; Array ( [:db_condition_placeholder_0] => zen_care4it ) in _ctools_block_load_blocks() (line 101 of /home/care4it/public_html/sites/all/modules/contrib/api/ctools/plugins/content_types/block/block.inc).
#1842524: Error: Base table or view not found {block}
i disabled blocks since i'm using a CTools based solution, but some pages are loading system blocks.
so shouldn't be able to turn blocks off
Drupal 7.19
Chaos tool suite (ctools) 7.x-1.2
Panelizer 7.x-3.0-rc1
Panels 7.x-3.3
Panels Everywhere 7.x-1.0-rc1
Comment #12
merlinofchaos CreditAttribution: merlinofchaos commentedHave you checked latest -dev? That function has an exit right at the top if block.module is not enabled.
Comment #13
lpalgarvio CreditAttribution: lpalgarvio commentedoh, sorry, didn't noticed that 7.x-1.2 was dated august, while the patch commited to dev is dated october.
thanks! i'll assume it's fixed.
Comment #14
SpleshkaThis solution do not solves all problems. See http://drupal.org/node/1842524#comment-7092686.
Comment #17
Deciphered CreditAttribution: Deciphered as a volunteer commentedRe-rolled patch.
Committed patch returns nothing to the ctools_content_renderer if the Block module is disabled if you are using a Block content pane, which is not necessary. Original patch as well as this patch allows the block content to render correctly even if the Block module is disabled.
Comment #18
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 7 July 2015 re-rolled patch in #17 applied cleanly to the latest ctools 7.x-1.x-dev and if still applicable needs to be reviewed.