Profile listings fail to show email addresses when their location type Name differs from its Display Name
Overview
If you create a location type and have different Names and Display Names, then a profile listing uses it fails to display the data.
Reproduction steps
- Create a new location type with Name say TestingTesting and Display Name 'Testing Testing'.
- Create a listing profile to display that location type.
- Assign an email address of that type to a user.
- Use the profile to display that user.
Current behaviour
Erik Adams detail viewed:
The email address does not show in the listing:
Expected behaviour
Environment information
What should happen.- Browser: MS Edge but probably not relevant
- CiviCRM: _ 5.52.alpha1._ It is the Demo system
- PHP Whatever Demo is running
- CMS: Drupal 9 the version Demo is running.
- Database: Whatever Demo is running.
- Web Server: Whatever runs Demo
Comments
I have spent a few hours attempting to debug on a local system, but haven't been able to discover where the SELECT statement is being created. What appears to be happening is that the SELECT statement is has the Name of the Location Type as a column, whilst the Profile is expecting the Display Name, so when they don't match, the latter displays nothing.
You should note that if the Name is say Testing_Testing and the Display Name is 'Testing Testing', that the data are displayed. This is because somewhere in the Profile display spaces are replaced by underscores. It is how I was able to obtain the expected behaviour.
I am flagging this up in the hope that someone with more expertise than I can more easily identify where the solution lies.