How to display profile fields with no data in BuddyPress profile view? [closed]

Create a template overload of this file: buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php

Then find this code:

<?php if ( bp_field_has_data() ) : ?>

    <tr<?php bp_field_css_class(); ?>>

       <td class="label"><?php bp_the_profile_field_name(); ?></td>

       <td class="data"><?php bp_the_profile_field_value(); ?></td>

    </tr>

<?php endif; ?>

And change it to:

<tr<?php bp_field_css_class(); ?>>

   <td class="label"><?php bp_the_profile_field_name(); ?></td>

   <td class="data"><?php bp_the_profile_field_value(); ?></td>

</tr>

EDIT: We need to force the fetching of empty fields…

So also find this:

<?php if ( bp_has_profile() ) : ?>

And change to this:

<?php $args = array( 'hide_empty_fields' => false, 'hide_empty_groups' => false ); ?>

<?php if ( bp_has_profile( $args ) ) : ?>

tech