Sessie 16 januari 2026: Profile Permission Errors & UI Fix¶
Context¶
Critical regressions in profile editing and admin UI surfaced during ticket system stabilization. Admin permissions page returned 500 errors, profile overview broke, and user51 couldn't edit customer profile due to redirect issues.
Problemen¶
Profile Entity Bundle Errors¶
/admin/people/permissionsreturned 500 internal server error/admin/people/profilescrashed with "call to getDisplayLabel() on null"- Cause: orphan profile entities with missing bundle (bundle=null)
- Blocked admin from managing permissions via UI
Profile Edit Redirect Loop¶
- User51 redirected from
/klantgegevens/editto/customer/add - User72 could edit profile normally
- ProfileViewController::edit only loaded active (status=1) profiles
- User51 had no active profile, triggering unwanted redirect
- Inconsistent UX across users
PDF Download Access Issues¶
- Assignees with accepted tickets couldn't download PDF
- Access control needed refinement for email-based lookup
- Theme preprocess errors during PDF generation
Oplossingen¶
Orphan Profile Diagnosis¶
Read-only audit queries prepared:
-- List all profile bundles
SELECT DISTINCT type FROM profile_field_data;
-- Find orphan profiles (bundle=null)
SELECT profile_id, uid, status, created
FROM profile_field_data
WHERE type IS NULL OR type = '';
Approach: identify scope before applying targeted cleanup or bundle recreation.
ProfileViewController Edit Patch¶
Modified ProfileViewController::edit method to prevent redirect:
- Remove redirect logic for missing active profiles
- Allow inline profile creation on edit route
- Consistent behavior for all users on /klantgegevens/edit
File: web/modules/contrib/profile/src/Controller/ProfileViewController.php
Temporary Permission Grant via CLI¶
Unblocked user51 profile editing without using broken UI:
drush role:perm:add authenticated 'create own customer profile'
drush role:perm:add authenticated 'edit own customer profile'
drush cr
PDF Access & Theme Fixes¶
- Updated
TicketPdfControlleraccess logic for assignee email lookup - Fixed
vg25_preprocess_commerce_licensenull entity handling - Improved Twig template for A4 layout and dynamic event data
Technische Details¶
Files Modified¶
ProfileViewController.php(profile module controller)TicketPdfController.php(PDF download access)vg25.theme(license preprocess)commerce-license--vgbc-ticket.html.twig(PDF template)
Routes¶
vg_commerce.profile_edit.customer→ ProfileViewController::editvg_commerce.ticket.pdf→ TicketPdfController::downloadPdf
Database¶
- Profile entities:
profile_field_datatable - Orphan records with null bundle identified as root cause
Status¶
- PDF access issues: Resolved
- Profile edit redirect: Patch prepared, pending apply
- Orphan profile cleanup: Diagnostic phase, awaiting user decision
- Permissions page 500: Linked to orphan profiles, fix pending
Volgende Stappen¶
- Apply ProfileViewController::edit patch
- Execute read-only profile audit
- Present cleanup options to user
- Restore admin permissions UI functionality
- Final PDF layout polish (ticket ID, logo positioning)
Links¶
- Related: 20260107-ticket-toewijzing-systeem
- Profile module:
web/modules/contrib/profile/ - Custom module:
web/modules/custom/vg_commerce/