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

Drupal 9 compatibility #156

Merged
merged 26 commits into from
Jun 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
413beeb
use version 3 of Devel, which supports D9
byrond Jun 3, 2020
ff49d21
make the_build_utility compatible with d9
byrond Jun 3, 2020
0c8dc7f
update deprecated function call in the_build_utility.install
byrond Jun 3, 2020
7ea0cf3
add shortcut as a dependency
byrond Jun 3, 2020
b6d73c9
switch to minimal profile for first install
byrond Jun 3, 2020
fba8470
remove the old line :facepalm:
byrond Jun 3, 2020
ea9b44b
use field_storage_config in the_build_utility.install
byrond Jun 4, 2020
095860e
change first install profile to "newstandard" (sans hook_install)
byrond Jun 4, 2020
83d2921
remove core module dependency
byrond Jun 4, 2020
dce4e34
use existing-config option instead of config_installer
byrond Jun 4, 2020
62eecfd
fix user registration setting value during the_build_utility install
byrond Jun 4, 2020
2a891c3
add hook_install from standard profile
byrond Jun 4, 2020
d08d751
update config for minimal profile after first install
byrond Jun 4, 2020
f93618b
switch back to standard profile for first install
byrond Jun 4, 2020
de85860
update change log from #147
byrond Jun 5, 2020
17e3159
add deprecation comment to defaults.yml
byrond Jun 5, 2020
48c6177
update shortcut weights
byrond Jun 5, 2020
2b3d081
update post first installation message
byrond Jun 5, 2020
9800a92
update default build.xml to enable/uninstall the_build_utility during…
byrond Jun 5, 2020
744c327
use the drupal9 branch of the skeleton for circle tests
byrond Jun 5, 2020
b2c450c
use php 7.3 on circle
byrond Jun 5, 2020
2120a71
don't reinstall the_build_utility on phing install
byrond Jun 5, 2020
e9809bf
remove standard profile hook_install contents
byrond Jun 5, 2020
cadf292
Break the change profile functionality out into a separate phing comm…
becw Jun 8, 2020
afe2516
Merge pull request #158 from palantirnet/change-profile
becw Jun 26, 2020
da6405c
Merge branch 'develop' into drupal9
becw Jun 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
working_directory: ~/example
docker:
- image: circleci/php:7.2-node-browsers
- image: circleci/php:7.3-node-browsers
- image: circleci/mysql:5.7-ram
command: --max_allowed_packet=16M
environment:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
# Create a new project using the drupal-skeleton project
- run:
name: Create a new Drupal project
command: composer create-project palantirnet/drupal-skeleton example dev-drupal8 --no-interaction
command: composer create-project palantirnet/drupal-skeleton example dev-drupal9 --no-interaction
working_directory: ~/

# Use this copy of the-build
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## UNRELEASED

### Changed

* `phing install` now uses `drush site-install --existing-config` instead of the [config_installer profile](https://www.drupal.org/project/config_installer) (#145)

### Deprecated

* The `drupal.site.profile` property is no longer used by the default `install` target in `build.xml`. It will be removed in the 3.0 release. (#145)

## 2.3.2

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ drupal:
hash_salt: temporary

# Drupal install profile to use for the drupal-install target.
#
# DEPRECATED - to be removed in 3.0
# This property was used in the 'install' target in the default build.xml, until
# we switched from the config_installer profile to using
# 'drush site-install --existing-config`.
profile: config_installer

# Drupal admin username, if you feel inclined to change it.
Expand Down
2 changes: 1 addition & 1 deletion defaults/install/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<option name="site-name">${projectname}</option>
<option name="account-name">${drupal.site.admin_user}</option>
<option name="account-pass">admin</option>
<param>${drupal.site.profile}</param>
<option name="existing-config" />
</drush>
</target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: the-build utility module
description: 'Base settings from palantirnet/the-build.'
type: module
core: 8.x
core_version_requirement: ^8 || ^9
hide: true

dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ use Drupal\shortcut\Entity\Shortcut;
function the_build_utility_install() {
// Allow visitor account creation with administrative approval.
$user_settings = \Drupal::configFactory()->getEditable('user.settings');
$user_settings->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save(TRUE);
$user_settings->set('register', 'admin_only')->save(TRUE);

// Populate the default shortcut set.
$shortcut = Shortcut::create([
'shortcut_set' => 'default',
'title' => t('Manage Taxonomy'),
'weight' => -20,
'weight' => -18,
'link' => ['uri' => 'internal:/admin/structure/taxonomy'],
]);
$shortcut->save();

$shortcut = Shortcut::create([
'shortcut_set' => 'default',
'title' => t('Manage Menus'),
'weight' => -19,
'weight' => -17,
'link' => ['uri' => 'internal:/admin/structure/menu'],
]);
$shortcut->save();

$shortcut = Shortcut::create([
'shortcut_set' => 'default',
'title' => t('Status Report'),
'weight' => -18,
'weight' => -16,
'link' => ['uri' => 'internal:/admin/reports/status'],
]);
$shortcut->save();
Expand All @@ -61,7 +61,7 @@ function the_build_utility_install() {

// Begin Comment module.
// Remove the comment fields.
$fields = entity_load_multiple_by_properties('field_storage_config', ['type' => 'comment']);
$fields = \Drupal::entityTypeManager()->getStorage('field_storage_config')->loadByProperties(['type' => 'comment']);
foreach ($fields as $field) {
$field->delete();
}
Expand Down
69 changes: 51 additions & 18 deletions targets/drupal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Or, you can specify the export file directly:
<composer command="require" composer="${composer.composer}">
<arg value="drupal/admin_toolbar" />
<arg value="drupal/config_split" />
<arg value="drupal/devel" />
<arg value="drupal/devel:^3.0" />
<arg value="drupal/workbench" />
<arg value="drupal/workbench_tabs" />
</composer>
Expand All @@ -276,22 +276,9 @@ Or, you can specify the export file directly:
<param>the_build_utility</param>
</drush>

<drush command="config-delete" assume="yes">
<param>core.extension</param>
<param>module.standard</param>
</drush>

<drush command="config-set" assume="yes">
<param>core.extension</param>
<param>module.config_installer</param>
<param>1000</param>
</drush>

<drush command="config-set" assume="yes">
<param>core.extension</param>
<param>profile</param>
<param>config_installer</param>
</drush>
<phingcall target="drupal-change-profile">
<property name="new_profile" value="minimal" />
</phingcall>

<drush command="pm-uninstall" assume="yes">
<param>the_build_utility</param>
Expand All @@ -302,12 +289,58 @@ Or, you can specify the export file directly:
<!-- Whitespace is intentional. -->
<echo>

Drupal has been installed with the install profile "standard". Future installs will be run using config_installer.
Drupal has been installed with the install profile "standard". If you'd prefer a different profile, run the installer yourself:
drush site-install minimal

Future installs via 'phing install' will be run using 'drush site:install --existing-config'.

Your config has been exported to ${drupal.root}/${drupal.site.config_sync_directory}</echo>
</target>


<target name="drupal-change-profile" description="Change the install profile on an existing Drupal site.">
<fail unless="new_profile" />

<!-- Get the name of the current profile. -->
<drush command="config-get" returnProperty="current_profile">
<param>core.extension</param>
<param>profile</param>
<option name="format">csv</option>
</drush>

<!-- If the current profile is enabled in the core extensions list, disable it. -->
<drush command="config-get" returnProperty="current_profile_weight">
<param>core.extension</param>
<param>module.${current_profile}</param>
<option name="format">csv</option>
</drush>

<if>
<not><equals arg1="${current_profile_weight}" arg2="" /></not>
<then>
<drush command="config-delete" assume="yes">
<param>core.extension</param>
<param>module.${current_profile}</param>
</drush>
</then>
</if>

<!-- Enable the new profile. -->
<drush command="config-set" assume="yes">
<param>core.extension</param>
<param>module.${new_profile}</param>
<param>1000</param>
</drush>

<!-- Update the profile setting itself. -->
<drush command="config-set" assume="yes">
<param>core.extension</param>
<param>profile</param>
<param>${new_profile}</param>
</drush>
</target>


<target name="drupal-add-multisite" description="Set up a new Drupal multisite.">
<if>
<equals arg1="${build.host}" arg2="pantheon" />
Expand Down