- Issue created by @alexpott
- π·π΄Romania amateescu
Maybe we could improve
\Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass
instead, and remove the backend-specific service from the container if the main service doesn't exist. - π¬π§United Kingdom alexpott πͺπΊπ
@amateescu but without views installed we have no idea that mysql.views.cast_sql exists to override views.cast_sql
- Merge request !10548Revert "Issue #3478621 by catch, longwave, nicxvan: Add filecache to OOP hook attribute parsing" β (Open) created by alexpott
- π·π΄Romania amateescu
@alexpott, but we do know that
mysql.views.cast_sql
is a backend override service because it's tagged withbackend_overridable
, and then we just need to split the backend name from its ID to find out the main service ID.I'm not sure that MR was meant for this issue though :)
- π¬π§United Kingdom alexpott πͺπΊπ
alexpott β changed the visibility of the branch 3493595-the-mysql.views.castsql-service to hidden.
- π¬π§United Kingdom alexpott πͺπΊπ
@amateescu we only know that it is an override once the views service exists. This is about sites without views installed. The MySQL service is not tagged.
Fixed the MR.
- π·π΄Romania amateescu
Ohh.. that's right, somehow I didn't realize that only the main service is tagged :)
The kernel test failure seems to be caused by this change.
- π¬π§United Kingdom alexpott πͺπΊπ
The kernel failure occurred because before we had two services in services.yml files implementing \Drupal\views\Plugin\views\query\CastSqlInterface and now we have 1 - ie. the one in views.services.yml so now it errors. The best fix is to add the missing alias. The fact this is in a plugin directory is odd because it is a backend overridable service and it only ever accessed in real runtime code by doing
\Drupal::service('views.cast_sql')
so it's not a plugin at all. Anyhow that's not something this issue needs to resolve. - First commit to issue fork.
- πΊπΈUnited States smustgrave
I only rebased to get the test-only feature to run
1) Drupal\Tests\mysql\Kernel\mysql\ViewsTest::testViewsService Failed asserting that false is identical to true. /builds/issue/drupal-3493595/core/modules/mysql/tests/src/Kernel/mysql/ViewsTest.php:33 /builds/issue/drupal-3493595/core/lib/Drupal/Core/DrupalKernel.php:1363 /builds/issue/drupal-3493595/core/lib/Drupal/Core/DrupalKernel.php:901 /builds/issue/drupal-3493595/core/lib/Drupal/Core/DrupalKernel.php:505 /builds/issue/drupal-3493595/core/tests/Drupal/KernelTests/KernelTestBase.php:378 /builds/issue/drupal-3493595/core/tests/Drupal/KernelTests/KernelTestBase.php:258 /builds/issue/drupal-3493595/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificKernelTestBase.php:48 /builds/issue/drupal-3493595/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificDatabaseTestBase.php:24 FAILURES! Tests: 1, Assertions: 1, Failures: 1.
So test coverage is good
Issue summary is clearFor the comment in #12 is that something that should be opened in a follow up?
Rest of the code (from what I can tell) seems fine to me.
-
longwave β
committed 778c9bd5 on 11.x
Issue #3493595 by alexpott, amateescu: The mysql.views.cast_sql service...
-
longwave β
committed 778c9bd5 on 11.x
- Status changed to Fixed
5 months ago 11:09pm 10 February 2025 Automatically closed - issue fixed for 2 weeks with no activity.