Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_select_profile() would be added as installation task even when all the installation profiles were hidden #6796

Open
avpaderno opened this issue Dec 29, 2024 · 0 comments · May be fixed by backdrop/backdrop#4960

Comments

@avpaderno
Copy link
Member

avpaderno commented Dec 29, 2024

install_tasks() contains the following code.

// Display profile task only when there is more than one non-hidden profile.
$hidden_profile_count = 0;
foreach ($install_state['profiles'] as $profile) {
  $profile_info = install_profile_info($profile->name);
  $hidden_profile_count += empty($profile_info['hidden']);
}
$display_select_profile = $hidden_profile_count > 1 && count($install_state['profiles']) != 1;

The code counts the number of hidden installation profiles, not the number of non-hidden installation profiles; $display_select_profile will be TRUE when there is more than one hidden installation profile, not when there is more than one non-hidden profile. (Backdrop core includes three different installation profiles, so count($install_state['profiles']) != 1 is TRUE.)

The correct code would be the following one.

// Display profile task only when there is more than one non-hidden profile.
$visible_profile_count = 0;
foreach ($install_state['profiles'] as $profile) {
  $profile_info = install_profile_info($profile->name);
  $visible_profile_count += !isset($profile_info['hidden']) || empty($profile_info['hidden']);
}
$display_select_profile = $visible_profile_count > 1 && count($install_state['profiles']) != 1;
@avpaderno avpaderno changed the title install_select_profile() would be added as installation task, even when all the installation profiles were hidden install_select_profile() would be added as installation task even when all the installation profiles were hidden Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant