Add core_version_requirement: ^8 || ^9 to account_settings_tab.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.

Rector 0.8.x-dev@8896f0a
Config file: rector.yml

 6/6 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

1 file with changes
===================

1) web/modules/contrib/user_private_fields/user_private_fields.module

    ---------- begin diff ----------
--- Original
+++ New
@@ -91,7 +91,7 @@
  */

 function user_private_fields_form_user_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  $entity_field_definitions = \Drupal::entityManager()
+  $entity_field_definitions = \Drupal::service('entity_field.manager')
     ->getFieldDefinitions('user', 'user');
   foreach ($entity_field_definitions as $field_key => $field_value) {
     $selected_field = strpos($field_key, 'field');
    ----------- end diff -----------

Comments

vatsalkhanna created an issue. See original summary.

vatsalkhanna’s picture

Assigned: vatsalkhanna » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.05 KB
rakesh.gectcr’s picture

+++ b/user_private_fields.module
@@ -91,7 +91,7 @@ function user_private_fields_form_field_config_edit_form_submit(&$form, FormStat
+  $entity_field_definitions = \Drupal::service('entity_field.manager')

EntitityTypeManager should be the one, Thanks

$entity_field_definitions = \Drupal::entityTypeManager()
    ->getFieldDefinitions('user', 'user');
rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
Status: Needs review » Needs work
rakesh.gectcr’s picture

rakesh.gectcr’s picture

Status: Needs work » Fixed

Thanks for your contribution.

Status: Fixed » Closed (fixed)

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

peri22’s picture

hi, I have fixed the patch.

peri22’s picture

StatusFileSize
new673 bytes