A similar issue has returned since upgrading to 1.4.6
Now, the default Profile view showing on profile view is 'Timeline' despite selecting 'About' in the 'Profile Default Display'
I can resolve the issue by changing the following code block in users.php:
From:
/**
* Retrieves the "about" information of a user.
*
* @since 1.3
* @access public
* @param string
* @return
*/
public function getAbout($user, $activeStep = 0)
{
// Load admin language files
FD::language()->loadAdmin();
// Get a list of steps
$model = FD::model('Steps');
$steps = $model->getSteps($user->profile_id, SOCIAL_TYPE_PROFILES, SOCIAL_PROFILES_VIEW_DISPLAY);
// Load up the fields library
$fieldsLib = FD::fields();
$fieldsModel = FD::model('Fields');
// Initial step
$index = 1;
$hasActive = false;
foreach ($steps as $step) {
// Get a list of fields from the current tab
$options = array('step_id' => $step->id, 'data' => true, 'dataId' => $user->id, 'dataType' => SOCIAL_TYPE_USER, 'visible' => SOCIAL_PROFILES_VIEW_DISPLAY);
$step->fields = $fieldsModel->getCustomFields($options);
// Trigger each fields available on the step
if (!empty($step->fields)) {
$args = array($user);
$fieldsLib->trigger('onDisplay', SOCIAL_FIELDS_GROUP_USER, $step->fields, $args);
}
// By default hide the step
$step->hide = true;
// As long as one of the field in the step has an output, then this step shouldn't be hidden
// If step has been marked false, then no point marking it as false again
// We don't break from the loop here because there is other checking going on
foreach ($step->fields as $field) {
// We do not want to consider "header" field as a valid output
if ($field->element == 'header') {
continue;
}
// Ensure that the field has an output
if (!empty($field->output) && $step->hide === true) {
$step->hide = false;
}
}
// Default step url
$step->url = FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about'), false);
if ($index !== 1) {
$step->url = FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about', 'step' => $index), false);
}
$step->title = $step->get('title');
$step->active = !$step->hide && $index == 1 && !$activeStep;
// If there is an activeStep set, we should respect that
if ($activeStep && $activeStep == $step->sequence) {
$step->active = true;
$hasActive = true;
}
// If the step is not hidden and there isn't any active set previously
// Also, it should be the first item on the list.
if (!$activeStep && !$step->hide && !$hasActive && $index == 1) {
$step->active = true;
$hasActive = true;
}
if ($step->active) {
$theme = FD::themes();
$theme->set('fields', $step->fields);
$step->html = $theme->output('site/profile/default.info');
}
$step->index = $index;
$index++;
}
return $steps;
}
To:
/**
* Retrieves the "about" information of a user.
*
* @since 1.3
* @access public
* @param string
* @return
*/
public function getAbout($user)
{
// Load admin language files
FD::language()->loadAdmin();
// Get a list of steps
$model = FD::model('Steps');
$steps = $model->getSteps($user->profile_id, SOCIAL_TYPE_PROFILES, SOCIAL_PROFILES_VIEW_DISPLAY);
// Load up the fields library
$fieldsLib = FD::fields();
$fieldsModel = FD::model('Fields');
// Initial step
$index = 1;
$hasActive = false;
foreach ($steps as $step) {
// Get a list of fields from the current tab
$options = array('step_id' => $step->id, 'data' => true, 'dataId' => $user->id, 'dataType' => SOCIAL_TYPE_USER, 'visible' => SOCIAL_PROFILES_VIEW_DISPLAY);
$step->fields = $fieldsModel->getCustomFields($options);
// Trigger each fields available on the step
if (!empty($step->fields)) {
$args = array($user);
$fieldsLib->trigger('onDisplay', SOCIAL_FIELDS_GROUP_USER, $step->fields, $args);
}
// By default hide the step
$step->hide = true;
// As long as one of the field in the step has an output, then this step shouldn't be hidden
// If step has been marked false, then no point marking it as false again
// We don't break from the loop here because there is other checking going on
foreach ($step->fields as $field) {
// We do not want to consider "header" field as a valid output
if ($field->element == 'header') {
continue;
}
// Ensure that the field has an output
if (!empty($field->output) && $step->hide === true) {
$step->hide = false;
}
}
// Default step url
$step->url = FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about'), false);
if ($index !== 1) {
$step->url = FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about', 'step' => $index), false);
}
$step->title = $step->get('title');
$step->active = !$step->hide && $index == 1;
if (!$step->hide && !$hasActive && $index > 1) {
$step->active = true;
$hasActive = true;
}
if ($step->active) {
$theme = FD::themes();
$theme->set('fields', $step->fields);
$step->html = $theme->output('site/profile/default.info');
}
$step->index = $index;
$index++;
}
return $steps;
}
It would really help to update this in the stable version of the component, assuming it is correct to do so.
Jordan