Change "blocks" to "block" for db_query because of table name change

Created on 16 December 2011, over 13 years ago
Updated 29 July 2025, about 2 months ago

The blocks table no longer exists in D7. It is now called block. Error shown:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xyz.blocks' doesn't exist: SELECT title FROM {blocks} WHERE module='featured_content' AND delta=:delta; Array ( [:delta] => 2 ) in featured_content_get_block_title() (line 1970 of /var/www/xyz/sites/all/modules/contrib/featured_content/featured_content.module).

Also need to fix the:

$row = $results[0];

to be:

$row = $result->fetchObject();  
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024