Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293246

Roles->preRender() - Call to a member function label() on null

$
0
0

Hi,

I have imported about 5,000 users with a role mapping using the static_map plugin. If you look in the user__roles table this appears to have worked with the users having been assigned to roles. However, when you go to /admin/people the site throws the following notice and error.

Notice: Undefined index: Members in Drupal\user\Plugin\views\field\Roles->preRender() (line 78 of /var/www/web/core/modules/user/src/Plugin/views/field/Roles.php)

Error: Call to a member function label() on null in Drupal\user\Plugin\views\field\Roles->preRender() (line 78 of /var/www/web/core/modules/user/src/Plugin/views/field/Roles.php)

I added the following if statement so I could see if any of the roles were showing up and none of them are.

if(isset($this->items[$role->uid][$role->rid]['role'])){

My user__roles table looks like this.

+--------+---------+-----------+-------------+----------+-------+-----------------+
| bundle. | deleted | entity_id | revision_id | langcode | delta | roles_target_id |
+--------+---------+-----------+-------------+----------+-------+-----------------+
| user | 0 | 1 | 1 | en | 0 | administrator |
| user | 0. | 3. | 3. | en | 1 | Site Admin |
| user | 0 | 8. | 8 | en | 0 | Members |
+--------+---------+-----------+-------------+----------+-------+-----------------+

Looking at the query I am not sure where the RIDs come from to run the query from MySQL workbench.

I did populate the matching names in the roles table before doing the migration.

Thanks,
Steve


Viewing all articles
Browse latest Browse all 293246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>