db_select use is deprecated and instead it should be used with \Drupal::database()->select

Comments

pifagor created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, webform-1.patch, failed testing.

pifagor’s picture

Status: Needs work » Needs review

Сheck error

jrockowitz’s picture

Status: Needs review » Fixed
pifagor’s picture

Status: Fixed » Needs review

is applied Patch https://www.drupal.org/node/2858358, but not with this Issue

jrockowitz’s picture

I want to keep this refactoring as simple as possible.

$db = \Drupal::database();
$aliases = $db->query(...)

to

$aliases = \Drupal::database()->query(...)
pifagor’s picture

StatusFileSize
new6.01 KB

jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed a10f802 on 8.x-5.x
    Revert "Issue #2858354 by pifagor: Deprecated db_select"
    
    This reverts...
jrockowitz’s picture

Status: Fixed » Needs review

Had to revert this patch.

pifagor’s picture

Patch has created some problems?

jrockowitz’s picture

Priority: Major » Normal

Yes, when I committed the patch, it broke automated tests on 8.x-5.x. I am not sure why the testbot is not reviewing this patch.

jrockowitz’s picture

StatusFileSize
new6.01 KB

Trying to get patch to run.

jrockowitz’s picture

My best guess is that the testbot did not like the original patch's naming convention.

Status: Needs review » Needs work

The last submitted patch, 15: deprecated_db_select-2858354-15.patch, failed testing.

mr.baileys’s picture

Title: Deprecated db_select » db_select() and db_query() deprecated
Status: Needs work » Needs review
StatusFileSize
new6.02 KB
new655 bytes

Test failures are caused by a db_select() that was incorrectly converted to \Drupal::database()->db_query()

Updated patch attached.

jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

pifagor’s picture

Thank