As per #2868876: Remove deprecated entitymanager and db_select, the database connection should be injected rather than making a static call to the database service.

Comments

John Pitcairn created an issue. See original summary.

johnpitcairn’s picture

Status: Active » Needs review
StatusFileSize
new2.43 KB

The solution proposed by @ushma in #2868876: Remove deprecated entitymanager and db_select is:

$query = $this->database->select('node', 'n', array('target' => 'replica'));

This works in that indexing completes, but throws a warning:

Warning: assert(): Passing "target" option to query() has no effect.

I think $this->databaseReplica should be used to query the database replica.

johnpitcairn’s picture

  • John Pitcairn authored fcfde34 on 8.x-1.x
    Issue #3246314 by John Pitcairn, ushma: Inject the database connection
    
johnpitcairn’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.