- Open on Drupal.org βCore: 9.5.x + Environment: PHP 7.3 & MySQL 8last update
over 1 year ago Waiting for branch to pass - πΊπΈUnited States Maather AlJabri
When upgrading the sqlsrv module to a version higher than 4.3.0 (i.e 4.3.1), sqlsrv.views.date_sql in sqlsrv.services.yml is set to private which means it cannot be accessed directly from the container at runtime. I changed the value in the public parameter from 'false' to 'true' in sqlsrv.services.yml and was able to fix the error. I attached a patch with the fix.
- Status changed to RTBC
over 1 year ago 10:04am 17 May 2023 - π¬π§United Kingdom pstewart
@Beakerboy is correct in #4 π Service not found exception Fixed , in that the intended approach for backend overridable services is that you would ask for the overridable service from the container (
views.date_sql
in this case) and you would get the correct backend version of the service corresponding to the preferred default backend configured in your site'sservices.yml
, e.g.parameters: default_backend: sqlsrv
This is presumably why the core backend implementations are marked private - they're only intended to ever be used via the backend override mechanism rather than injected directly at runtime. However this doesn't take into account use cases where the database driver is used to access a secondary database, where defining the default_backend in that way is not applicable (if the primary database is Mysql then the default backend still needs to be
mysql
).Allowing the
sqlsrv.views.date_sql
to be public is therefore necessary to facilitate these kinds of use cases, so Maather's patch in #6 π Service not found exception Fixed is the correct fix. -
pstewart β
committed ec0bb957 on 4.3.x authored by
Maather AlJabri β
Issue #3259467 by Maather AlJabri, scotthreha: Service not found...
-
pstewart β
committed ec0bb957 on 4.3.x authored by
Maather AlJabri β
- Status changed to Fixed
over 1 year ago 10:31am 22 May 2023 Automatically closed - issue fixed for 2 weeks with no activity.