1

When I construct unattended installation using for instance:

drush site-install my_inst_profile \
  --account-mail='helpdesk@acme.com' \
  --account-name='siteadm' \
  --account-pass='sitepass' \
  --db-su='dbadm' \
  --db-su-pw='dbpass' \
  --db-url='mysql://drupal:drupal@mysqldb/drupal' \
  --locale='pl' \
  --site-mail='site@acme.com' \
  --site-name='MY Site' \
  --yes

and even the simplest possible installation profile my_inst_profile.info.yml, my_inst_profile.install and my_inst_profile.profile taken directly from How to write a Drupal 8 installation profile, the resulted installation is malfunctioning.

The symptoms are as follows:

  1. Lack of the middle part of the GUI enter image description here
  2. No administrator role in the resulted system
  3. Stark theme used as a default one even if info.yml file indicates any other theme.

It is relatively easy to handle 2 and 3 using:

drush role-create 'administrator'
drush config-set user.role.administrator is_admin true

and

drush pm-enable seven --yes
drush config-set system.theme admin seven --yes

respectively. But the first one exceeds my Drupal capabilities.

There is some discussion and an issue queued on the net (see Adding translations to installation profile upon installation), but the proposals are no longer valid, as there is no /includes/locale.inc and even locale_add_language(), in Drupal 8.

Does anybody have any hints, on how to bring together ambition to use custom distribution with necessity to build localized site?

Addendum 1

Here is my_inst_profile.info.yml

name: my_inst_profile
type: profile
description: 'Installation profile dedicated for ACME company.'
core: 8.x

distribution:
  name: ACME Installation Profile

# Required modules
dependencies:
  - node
  - history
  - block
  - block_content
  - breakpoint
  - color
  - config
  - comment
  - contextual
  - contact
  - quickedit
  - help
  - image
  - options
  - path
  - taxonomy
  - dblog
  - search
  - shortcut
  - toolbar
  - field_ui
  - file
  - rdf
  - views
  - views_ui
  - editor
  - ckeditor

themes:
#  - bartik
  - seven
#  - stark

Here is my_inst_profile.install

<?php
/**
 * @file
 * Install, update and uninstall functions for the profilename install profile.
 */

/**
 * Implements hook_install().
 *
 * Perform actions to set up the site for this profile.
 *
 * @see system_install()
 */
function my_inst_profile_install() {
  // First, do everything in standard profile.
  include_once DRUPAL_ROOT . '/core/profiles/standard/standard.install';
  standard_install();

  // Can add code in here to make nodes, terms, etc.
}

Here is my_inst_profile.profile

<?php
/**
 * @file
 * Enables modules and site configuration for a standard site installation.
 */

use Drupal\Core\Form\FormStateInterface;

function my_inst_profile_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {

  $form['site_information']['site_name']['#default_value'] = 'MY Site';
  $form['site_information']['site_mail']['#default_value'] = 'helpdesk@acme.com';
  $form['admin_account']['account']['name']['#default_value'] = 'siteadm';
  $form['admin_account']['account']['mail']['#default_value'] = 'helpdesk@acme.com';
  $form['regional_settings']['site_default_country']['#default_value'] = 'PL';
  $form['regional_settings']['date_default_timezone']['#default_value'] = 'Europe/Warsaw';

}

// Add any further custom code here like hook implementations.

As I mentioned at the beginning, this is just a starting point for further installation profile development.

4

Those are not bugs and have nothing to do with locale.

The standard install profile sets up the administrator role, the theme configuration and many other things, see standard_install() and its default configuration files like the overriden system.theme.yml.

I guess you mean the local tasks with "middle part of the GUI", that is a block and also set up by Standard, like many other blocks too.

If you create a new theme, it makes sense to look at standard on how it does things and copy the parts you need from it.

  • Thank you for the answer. Please, find in the article at the very first link in my question that the only thing that my installation profile does is standard_install(); invocation. Any penny less any penny more. Is there anything more that I should do to make standard install profile do its job properly? – utom Feb 6 '17 at 7:38
  • Hi, again. I've just done one more test to check your hint that Those ... have nothing to do with locale. Indeed, when I change locale into en the phenomenon still occurs. On the other hand then I remove the installation profile from my system, the phenomenon vanishes. My conclusion is, there is something wrong with this basic installation profile. But what is it? – utom Feb 6 '17 at 8:06
  • I find that approach of calling standard_install() strange, it saves you a few lines of code but sooner or later you will want to alter what it does or not do some things, I would just copy it. The other part of what I mentioned is config files, you didn't comment on whether you have those or not. Looks to me like you don't. – Berdir Feb 6 '17 at 8:10
  • Sorry for the omission. Yes, I've got them. As a prove we can take the fact, that when I remove the custom installation profile from my system, the phenomenon vanishes regardless I enter pl or en value into locale. The installation is done with composer create-project drupal-composer/drupal-project:8.x-dev D8Facility --stability=DEV --no-interaction. The custom installation profile is taken from official Druapl 8 article. So, what improvement do you suggest? – utom Feb 6 '17 at 8:19
  • When writing the question I've inferred some insights from the discussion. I see, that it is 5 years old, but the context and symptoms are very similar. Moreover, it is connected to still open issue. – utom Feb 6 '17 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.