Problem/Motivation

When the twilio module is enabled but the twilio_user database
table is missing, every page load throws a fatal error:

SQLSTATE[42S02]: Base table or view not found: 1146
Table 'dokilink_forms_iventmaster.twilio_user' doesn't exist
in twilio_user_load() (line 138 of modules/contrib/twilio/twilio.module)

Steps to reproduce

1. Enable twilio module
2. Have missing or incomplete database schema (twilio_user table missing)
3. Visit any page on the site
4. Fatal error is thrown on every page load

Proposed resolution

Add a table existence check in twilio_user_load() before querying:

if (!\Drupal::database()->schema()->tableExists('twilio_user')) {
return [];
}

Or ensure hook_schema() properly creates the table during module install.

Remaining tasks

- Create and test the patch
- Review and commit

User interface changes

None

API changes

None

Data model changes

None

Issue fork twilio-3580413

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

oluabbeys created an issue. See original summary.

oluabbeys’s picture

Status: Active » Needs review
vinodhini.e’s picture

Hi, Tested this module on Drupal 11.2.5.

Followed the steps to reproduce the issue by missing twilio_user table.

Before applying MR #39:

Encountered a fatal error on all pages:

SQLSTATE[42S02]: Base table or view not found: 1146
Table 'twilio_user' doesn't exist

After applying MR #39:

The issue is resolved. All pages are loading correctly without any fatal errors.

Thanks.

All pages are loading correctly without any fatal errors.

oluabbeys’s picture

Status: Needs review » Reviewed & tested by the community

Thank you @vinodhini.e for testing the fix and confirming it resolves the issue on Drupal 11.2.5. Marking as RTBC.