TypeError: strtr(): Argument #2 ($from) must be of type array, string given in strtr() (line 115 of /var/www/html/docroot/modules/syslog/syslog.module).

Created on 23 March 2023, almost 2 years ago
Updated 18 April 2023, almost 2 years ago

Problem/Motivation

When using drush to run database updates after trying to upgrade from search_api_acquia to acquia_search there are errors output to the console.
TypeError: strtr(): Argument #2 ($from) must be of type array, string given in strtr() (line 115 of /var/www/html/docroot/modules/syslog/syslog.module).

I think these stem from the module using an empty string instead of an empty array or a NULL value in the watchdog calls.
e.g.:

// Disable Search API Acquia module.
if (module_exists('search_api_acquia')) {
  module_disable(['search_api_acquia']);
  watchdog('acquia_search', 'Search API Acquia has been disabled. You can safely remove it from your codebase.', '', WATCHDOG_INFO);
}

Steps to reproduce

Have a d7 site with search_api_acquia setup
Download an install acquia_search
Run:
drush updb

Proposed resolution

Fix the watchdog issues

Review the patch
Commit the patch

Remaining tasks



Review the patch
Commit the patch

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom the_g_bomb

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

Comments & Activities

Production build 0.71.5 2024