Problem/Motivation
I run a D9.5.10 in linux with a MSSQL as Drupal database using the sqlsrv driver.
I also use the ip2country module which originally uses the LIMIT setting so for that i created a patch
making it use
->range(0,1) instead
https://www.drupal.org/project/ip2country/issues/3368606
π
Fails in MSSql due to limit, must use Range on object
Fixed
Now weeks of wounderful site it fails as it turns out that
core/lib/Drupal/Core/Database/StatementWrapper.php ,Lines 98-103
public function __call($method, $arguments) {
if (is_callable([$this->getClientStatement(), $method])) {
@trigger_error("StatementWrapper::{$method} should not be called in drupal:9.1.0 and will error in drupal:10.0.0. Access the clie>
return call_user_func_array([$this->getClientStatement(), $method], $arguments);
}
throw new \BadMethodCallException($method);
}
Is looking for the range function, and that does not exists and therefore it fails.
As this is deprechiated in later versions i found out that if i add
public function range($start = NULL, $length = NULL) {
$this->range = func_num_args() ? array(
'start' => $start,
'length' => $length,
) : array();
return $this;
}
It starts to work again.
I dont know why, how what, where this is best to be adressed, so ill adress it here, hoping for clearance and help.
Ill also provide a patch
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet