$prefix is empty when calling Roomify\Bat\Store\DrupalDBStore function

Created on 18 April 2024, 8 months ago
Updated 16 August 2024, 4 months ago

Problem/Motivation

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Sql1433464_5.bat_event_[state]_day_event' doesn't exist: SELECT * FROM bat_event_[state]_day_event WHERE year IN (2024) AND month IN (4) AND unit_id in (1) ORDER BY unit_id, year, month; Array ( ) in Roomify\Bat\Store\DrupalDBStore->getEventData() (line 37 of /modules/bat/lib/roomify-bat/1.4.0/src/Store/DrupalDBStore.php).


wrong test of database prefix: in my case I had "ab_" prefix that's not passed in DrupalDBStore function call

Steps to reproduce

creating a new event

Proposed resolution

change
$prefix = (isset($database['default']['prefix']['default'])) ? $database['default']['prefix']['default'] : '';
to
$prefix = (isset($database['default']['prefix'])) ? $database['default']['prefix'] : '';
in all module functions where prefix table check appears

🐛 Bug report
Status

Needs work

Version

10.1

Component

Code

Created by

🇮🇹Italy antonio.bertolini

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024