Hello, this module triggers an error in the background because it uses a deprecated (db_select) function.

The offending file is: /src/Core/Helper.php line 45 and 69

db_select: https://api.drupal.org/api/drupal/core%21includes%21database.inc/functio...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dasj19 created an issue. See original summary.

dasj19’s picture

FileSize
1.04 KB

Here is a simple fix.

Sergiu Stici’s picture

Status: Active » Needs review
FileSize
2.76 KB

I ran php drupal-check.phar modules/contrib/structured_data/ and I got a lot of deprecated function.
Here is the result.

4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------ 
  Line   src/Core/Helper.php                       
 ------ ------------------------------------------ 
  45     Call to deprecated function db_select().  
  69     Call to deprecated function db_select().  
  99     Call to deprecated function db_insert().  
  105    Call to deprecated function db_update().  
 ------ ------------------------------------------ 

 ------ --------------------------------------------------- 
  Line   src/Form/PageJsonForm.php                          
 ------ --------------------------------------------------- 
  86     Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 5 errors  

I created a patch, please review.

dasj19’s picture

Cool, Thanks #3 I did not know about drupal-check, That's a cool tool to have.
Your patch is working so far, I added it to my composer.json

baikho’s picture

Category: Bug report » Task
Status: Needs review » Needs work
Issue tags: +Drupal 9 compatibility

Updating issue to address the other deprecation errors from #3

baikho’s picture

Title: Use of deprecated db_select() » Drupal 9 Deprecated Code Report

  • baikho committed cf7526a on 8.x-1.x authored by Sergiu Stici
    Issue #3068495 by dasj19, Sergiu Stici, baikho: Drupal 9 Deprecated Code...
baikho’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
Status: Needs work » Fixed

Sorry I overlooked the patch in #3, committed to 8.x-1.x-dev.

Status: Fixed » Closed (fixed)

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