Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300130

statementwrapper have no range

$
0
0

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

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


Viewing all articles
Browse latest Browse all 300130

Latest Images

Trending Articles


Practice Sheet of Pronoun References for HSC Students


Download: Alice Chuma – Okondewa


Neem Baba Extra Questions Answer Class 6 English Poorvi


CalCen


Muloraki Au


Mahakal Attitude Status


Love (2015).H264.Italian.English.Ac3.5.1.multisub.iCV-MIRCrew Seed (62)/Leech...


MUSIC STATION – 2017.09.01


Waves Complete v2019.02.14 Incl Emulator-R2R


Students hit streets to save Agriculture College land in city



Latest Images