Problem/Motivation

As a part of D9 readiness update, deprecated method calls should be removed and replaced with suggested calls.
This issue is for all issues in data_search module.

Below is drupal-check report:

~/.config/composer/vendor/bin/drupal-check -d -- data_search/
 3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------- 
  Line   data_search.admin.inc                                                    
 ------ ------------------------------------------------------------------------- 
  15     Call to deprecated function drupal_set_message():                        
         in Drupal 8.5.0 and will be removed before Drupal 9.0.0.                 
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.     
  70     Call to deprecated function drupal_render():                             
         as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use the         
  77     Call to deprecated function drupal_render_children():                    
         in Drupal 8.0.x and will be removed before 9.0.0. Avoid early            
         rendering when possible or loop through the elements and render them as  
         they are available.                                                      
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   data_search.install                                                      
 ------ ------------------------------------------------------------------------- 
  17     Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  18     Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  19     Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   data_search.module                                                       
 ------ ------------------------------------------------------------------------- 
  88     Call to deprecated function db_query_range():                            
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call queryRange() on it. For example,                                    
  92     Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  101    Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  117    Call to deprecated function db_update():                                 
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call update() on it. For example,                                        
  135    Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  137    Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  156    Call to deprecated function db_escape_table():                           
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call escapeTable() on it. For example,                                   
  160    Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
  162    Call to deprecated function db_query():                                  
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get        
         a database connection injected into your service from the container and  
         call query() on it. For example,                                         
 ------ ------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 15 errors                                                                                                
                            

Proposed resolution

Replace deprecated function calls with suggested replacements.

Remaining tasks

Just do it.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

abramm created an issue. See original summary.

abramm’s picture

Issue tags: +Amsterdam2019

I'm going to check this now.

abramm’s picture

The data_search module seems to not work at all and I'm not sure if it's ever needed.

There are problems with module install (refering non-existing table), using deprecated hooks (hook_menu, hook_theme), etc.

The fact that noone noticed this since initial D7 to D8 port could mean no one is using it, so leaving it as is for now.

kristen pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

andriyun’s picture

Issue summary: View changes

There is another issue with Drupal 9 readiness changes.
#3091460: Deprecations removal. Drupal 9 readiness

andriyun’s picture

Status: Active » Closed (duplicate)
andriyun’s picture

Status: Closed (duplicate) » Active
Related issues: +#3091460: Deprecations removal. Drupal 9 readiness

Oh. It's about not handled part of Drupal 7 to 8/9 migration.

It looks like data_search module was abandoned or missed during migration

function data_search_menu() {
  $items = array();
  $items['admin/structure/data/edit/%data_ui_table/search'] = array(
    'title' => 'Configure search',
    'description' => 'Administer data tables.',