It was removed because it was completely broken, we want it back.
We need to provide a default view that displays all profiles entities of a specific bundle, using entity view mode display. This will be used to render the profile type groupings on user view and profile types that support multiple profiles.
This view should be embedded in \Drupal\profile\Controller\ProfileController::userProfileForm().
We currently have
// Render the active profiles.
$build['active_profiles'] = [
'#theme' => 'profile_items',
'#profile_items' => $active_profiles,
'#title' => $this->t('Active @type', ['@type' => $profile_type->label()]),
];
// List all inactive profiles.
$build['inactive_profiles'] = [
'#theme' => 'profile_items',
'#profile_items' => $inactive_profiles,
'#title' => $this->t('Inactive @type', ['@type' => $profile_type->label()]),
];
This theme hook implementation should be replaced with a view. However we are blocked, technically, on #2630610: Provide "Edit" and "Delete" links as part of the Profile entity view as we need edit and delete links to render.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | recover_the_profile-2617272-28.patch | 21.62 KB | mglaman |
| #25 | recover_the_profile-2617272-25.patch | 21.62 KB | mglaman |
| #20 | recover_the_profile-2617272-20.patch | 18.67 KB | mglaman |
| #19 | recover_the_profile-2617272-19.patch | 18.47 KB | mglaman |
| #16 | recover_the_profile-2617272-16.patch | 12.92 KB | mglaman |
Comments
Comment #2
mglamanComment #3
mglamanLinking to some related tickets.
Comment #4
czigor commentedComment #5
mglamanComment #6
czigor commentedThis issue depends on #2632068: Rendered entity views field handler.
Comment #7
czigor commentedGiven that the target of #2632068: Rendered entity views field handler is 8.1.x maybe we should do this without the Rendered entity views field handler just using several fields. We could switch to using the Rendered entity views field handler when 8.1.0 is released.
Comment #8
bojanz commentedWe can't implement the view without rendering the entity, cause you can't guess which fields will be shown (billing info has an address, personal information doesn't, etc).
We'll need to reimplement the handler in our module (or add it to Entity and add a dependency).
Comment #9
mglamanI vote for adding it to Entity and making it a dependency, since Entity API will hopefully be items added to core.
Comment #10
mglamanThis is postponed by
Comment #11
mglamanWe now have the rendered field in Entity API. We will need to make that a dependency.
Comment #12
mglamanComment #13
mglamanWe have a slight issue. \Drupal\Core\Url can't generate our "edit-form" route because it has multiple parameters.
It knows profile, but it does not know user or profile_type. I tried checking Core and nothing else follows this pattern. Posting patch with View and basic start for now. We'll probably need to alter the edit route.
Comment #16
mglamanNext iteration. Still needs some work, but much closer.
Comment #19
mglamanRemoves theme hook and solely uses view.
Comment #20
mglamanForgot Views as an dependency
Comment #25
mglamanThis fixes up a few items, including missing permission in a test
Comment #28
mglamanTypo on var name.
Comment #30
mglamanFixed!