function workspaces_post_update_modify_base_field_author_override

Updates stale references to Drupal\workspaces\Entity\Workspace::getCurrentUserId.

File

core/modules/workspaces/workspaces.post_update.php, line 44

Code

function workspaces_post_update_modify_base_field_author_override() {
    $uid_fields = \Drupal::entityTypeManager()->getStorage('base_field_override')
        ->getQuery()
        ->condition('entity_type', 'workspace')
        ->condition('field_name', 'uid')
        ->condition('default_value_callback', 'Drupal\\workspaces\\Entity\\Workspace::getCurrentUserId')
        ->execute();
    foreach (BaseFieldOverride::loadMultiple($uid_fields) as $base_field_override) {
        $base_field_override->setDefaultValueCallback('Drupal\\workspaces\\Entity\\Workspace::getDefaultEntityOwner')
            ->save();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.