diff --git a/.travis.yml b/.travis.yml index b5c736fbb..b330e43c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ php: - 7.0 env: - VERSION=HEAD - - VERSION=3.1.7 + - VERSION=3.2.0-beta1 # The final CI slot should be used to test the update path from the oldest # available database fixture. - VERSION=3.0.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5732c9f33..1d6444887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 3.2.0 +* Drupal core has been updated to 8.6.0. +* The `lightning:subprofile` command is no longer compatible with the + sub-profile system from Drupal 8.5.x. The `dependencies` list is replaced by + `install`, `base profile` is the name of the base profile instead of an + array, and all excluded modules and themes are listed in a single `exclude` + array. (#585) + ## 3.1.7 * Lightning API has been updated to 2.7, which fixes a persistent warning that could occur as a result of the OpenAPI module's beta2 update. diff --git a/UPDATE.md b/UPDATE.md index 2514145ca..570a92fd8 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -170,6 +170,30 @@ are currently running 2.2.0 and are trying to update to 2.2.6, you will need to follow the instructions for updating from 2.2.0 to 2.2.1, then from 2.2.1 to 2.2.2, in that order. +### 3.1.7 to 3.2.0-beta1 +* If you have any sub-profiles (regardless of whether or not they extend + Lightning), you must change their info files to work with Drupal 8.6.0: + * Change `base profile` to a string, containing the name of the base + profile. For example: `base profile: lightning`. + * Change the `dependencies` key to `install`. + * If you have any excluded dependencies or themes, merge them into a + single array, with the key `exclude`. + For example, an 8.6.0-compatible sub-profile info file will look something + like this: +``` +name: My Profile +core: 8.x +type: profile +base profile: lightning +install: + - paragraphs + - slick_entityreference +exclude: + - lightning_search + - pathauto + - bartik +``` + ### 3.1.6 to 3.1.7 * There are no manual update steps for this version. diff --git a/composer.json b/composer.json index 4f77b87d2..1bbacdfeb 100644 --- a/composer.json +++ b/composer.json @@ -88,10 +88,10 @@ "require": { "cweagans/composer-patches": "^1.6.4", "drupal/lightning_api": "2.x-dev", - "drupal/lightning_core": "2.x-dev", + "drupal/lightning_core": "3.x-dev", "drupal/lightning_layout": "1.x-dev", - "drupal/lightning_media": "2.x-dev", - "drupal/lightning_workflow": "2.x-dev", + "drupal/lightning_media": "3.x-dev", + "drupal/lightning_workflow": "3.x-dev", "drupal-composer/drupal-scaffold": "^2.0.0", "oomphinc/composer-installers-extender": "^1.1" }, diff --git a/composer.lock b/composer.lock index dd5798918..f3124430e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ffa1bac4888852ac764d3413b38cb5b5", + "content-hash": "5e33fd333a33dd49c70f59101dfc5a8a", "packages": [ { "name": "asm89/stack-cors", @@ -1088,16 +1088,16 @@ }, { "name": "drupal/core", - "version": "8.5.6", + "version": "8.6.x-dev", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "7d7184a69ac90ce53929ce99f18458043416107a" + "reference": "f6bf9352c33e9b34948313ce79c828fdaf839f25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/7d7184a69ac90ce53929ce99f18458043416107a", - "reference": "7d7184a69ac90ce53929ce99f18458043416107a", + "url": "https://api.github.com/repos/drupal/core/zipball/f6bf9352c33e9b34948313ce79c828fdaf839f25", + "reference": "f6bf9352c33e9b34948313ce79c828fdaf839f25", "shasum": "" }, "require": { @@ -1215,10 +1215,12 @@ "drupal/link": "self.version", "drupal/locale": "self.version", "drupal/media": "self.version", + "drupal/media_library": "self.version", "drupal/menu_link_content": "self.version", "drupal/menu_ui": "self.version", "drupal/migrate": "self.version", "drupal/migrate_drupal": "self.version", + "drupal/migrate_drupal_multilingual": "self.version", "drupal/migrate_drupal_ui": "self.version", "drupal/minimal": "self.version", "drupal/node": "self.version", @@ -1250,7 +1252,8 @@ "drupal/user": "self.version", "drupal/views": "self.version", "drupal/views_ui": "self.version", - "drupal/workflows": "self.version" + "drupal/workflows": "self.version", + "drupal/workspaces": "self.version" }, "require-dev": { "behat/mink": "1.7.x-dev", @@ -1261,7 +1264,7 @@ "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", "mikey179/vfsstream": "^1.2", "phpspec/prophecy": "^1.4", - "phpunit/phpunit": "^4.8.35 || ^6.1", + "phpunit/phpunit": "^4.8.35 || ^6.5", "symfony/css-selector": "^3.4.0", "symfony/debug": "^3.4.0", "symfony/phpunit-bridge": "^3.4.3" @@ -1298,15 +1301,11 @@ "merge-extra": false }, "patches_applied": { - "1356276 - Allow profiles to provide a base/parent profile and load them in the correct order": "https://www.drupal.org/files/issues/1356278-408--8.5.x-real.patch", - "2880374 - Experimental modules should not have warnings after being installed": "https://www.drupal.org/files/issues/2880374-remove-experimental-warnings-6.patch", "2869592 - Disabled update module shouldn't produce a status report warning": "https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch", "2885441 - EntityReferenceAutocompleteWidget should define its size setting as an integer": "https://www.drupal.org/files/issues/2885441-2.patch", - "2815221 - Add quickedit to the latest-revision route": "https://www.drupal.org/files/issues/2018-06-07/2815221-102.patch", - "2921661 (follow-up): Add support to migrate multilingual revisions": "https://www.drupal.org/files/issues/2018-07-04/2921661-86-8.6.x.patch", - "2877383 - Add action support to Media module": "https://www.drupal.org/files/issues/2877383-56.patch", - "2670730 - Provide a delete action for each content entity type": "https://www.drupal.org/files/issues/2670730-81-89-8.5.0-rc1.patch", - "2945571 - Off canvas looks funky when using Seven theme": "https://www.drupal.org/files/issues/2018-08-22/off-canvas-2945571-19.patch" + "2815221 - Add quickedit to the latest-revision route": "https://www.drupal.org/files/issues/2018-07-09/2815221-105.patch", + "1356276 - Allow profiles to define a base/parent profile and load them in the correct order": "https://www.drupal.org/files/issues/2018-07-12/1356276-473.patch", + "2914389 - Allow profiles to exclude dependencies of their parent": "https://www.drupal.org/files/issues/2018-07-09/2914389-8-do-not-test.patch" } }, "autoload": { @@ -1330,7 +1329,7 @@ "GPL-2.0-or-later" ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", - "time": "2018-08-01T20:50:42+00:00" + "time": "2018-08-31T07:43:48+00:00" }, { "name": "drupal/crop", @@ -2222,24 +2221,18 @@ }, { "name": "drupal/lightning_api", - "version": "2.7.0", + "version": "dev-2.x", "source": { "type": "git", "url": "https://git.drupal.org/project/lightning_api", - "reference": "8.x-2.7" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/lightning_api-8.x-2.7.zip", - "reference": "8.x-2.7", - "shasum": "432b0d59cf1b863efe950ab0a7a66eda6d4e16b3" + "reference": "e7df70ae662305605b06ba73aad9d8e2bc6d0f83" }, "require": { "cweagans/composer-patches": "^1.6.4", "drupal-composer/drupal-scaffold": "^2.0.0", "drupal/core": "~8.0", "drupal/jsonapi": "^1.22.0", - "drupal/lightning_core": "^2.9 || ^3.0", + "drupal/lightning_core": "2.x-dev || 3.x-dev", "drupal/openapi": "^1.0-beta2", "drupal/openapi_ui_redoc": "^1.0", "drupal/openapi_ui_swagger": "^1.0", @@ -2257,11 +2250,11 @@ "dev-2.x": "2.x-dev" }, "drupal": { - "version": "8.x-2.7", + "version": "8.x-2.7+1-dev", "datestamp": "1535722380", "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." } }, "installer-types": [ @@ -2330,28 +2323,23 @@ "homepage": "https://www.drupal.org/project/lightning_api", "support": { "source": "http://cgit.drupalcode.org/lightning_api" - } + }, + "time": "2018-08-31T13:31:38+00:00" }, { "name": "drupal/lightning_core", - "version": "2.9.0", + "version": "dev-3.x", "source": { "type": "git", "url": "https://git.drupal.org/project/lightning_core", - "reference": "8.x-2.9" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/lightning_core-8.x-2.9.zip", - "reference": "8.x-2.9", - "shasum": "ee35cfe01b89680696e40c43ac2a2e5294437e91" + "reference": "acd3f6bd16caba7fc8daefd41bdb66ca42e19255" }, "require": { "cweagans/composer-patches": "^1.6.4", "drupal-composer/drupal-scaffold": "^2.0.0", "drupal/acquia_connector": "^1.1", "drupal/contact_storage": "^1.0", - "drupal/core": "~8.5.6", + "drupal/core": "8.6.x-dev", "drupal/metatag": "^1.0", "drupal/pathauto": "^1.0", "drupal/search_api": "^1.0", @@ -2366,19 +2354,20 @@ "acquia/lightning_dev": "dev-8.x-1.x", "drupal/console": "^1.6", "drupal/contact_storage": "*", + "drupal/schema_metatag": "^1.3", "drupal/search_api": "*" }, "type": "drupal-module", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-3.x": "3.x-dev" }, "drupal": { - "version": "8.x-2.9", - "datestamp": "1535550151", + "version": "8.x-3.0-beta1+4-dev", + "datestamp": "1535492880", "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." } }, "installer-types": [ @@ -2406,12 +2395,11 @@ }, "patches": { "drupal/core": { - "1356276 - Allow profiles to provide a base/parent profile and load them in the correct order": "https://www.drupal.org/files/issues/1356278-408--8.5.x-real.patch", - "2880374 - Experimental modules should not have warnings after being installed": "https://www.drupal.org/files/issues/2880374-remove-experimental-warnings-6.patch", "2869592 - Disabled update module shouldn't produce a status report warning": "https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch", "2885441 - EntityReferenceAutocompleteWidget should define its size setting as an integer": "https://www.drupal.org/files/issues/2885441-2.patch", - "2815221 - Add quickedit to the latest-revision route": "https://www.drupal.org/files/issues/2018-06-07/2815221-102.patch", - "2921661 (follow-up): Add support to migrate multilingual revisions": "https://www.drupal.org/files/issues/2018-07-04/2921661-86-8.6.x.patch" + "2815221 - Add quickedit to the latest-revision route": "https://www.drupal.org/files/issues/2018-07-09/2815221-105.patch", + "1356276 - Allow profiles to define a base/parent profile and load them in the correct order": "https://www.drupal.org/files/issues/2018-07-12/1356276-473.patch", + "2914389 - Allow profiles to exclude dependencies of their parent": "https://www.drupal.org/files/issues/2018-07-09/2914389-8-do-not-test.patch" } }, "drush": { @@ -2466,21 +2454,16 @@ "homepage": "https://www.drupal.org/project/lightning_core", "support": { "source": "http://cgit.drupalcode.org/lightning_core" - } + }, + "time": "2018-08-31T16:40:12+00:00" }, { "name": "drupal/lightning_layout", - "version": "1.4.0", + "version": "dev-1.x", "source": { "type": "git", "url": "https://git.drupal.org/project/lightning_layout", - "reference": "8.x-1.4" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/lightning_layout-8.x-1.4.zip", - "reference": "8.x-1.4", - "shasum": "c09c186c30c4dcd9902a141b437d69d02146ef4b" + "reference": "f16a2fa0be8f15c8577485d0f1814a8b8c27d791" }, "require": { "cweagans/composer-patches": "^1.6.4", @@ -2488,7 +2471,7 @@ "drupal/core": "~8.0", "drupal/ctools": "^3.0", "drupal/entity_block": "^1.0", - "drupal/lightning_core": "^1.0 || ^2.9 || ^3.0", + "drupal/lightning_core": "1.x-dev || 2.x-dev || 3.x-dev", "drupal/panelizer": "^4.1", "drupal/panelizer_quickedit": "*", "drupal/panels": "4.3", @@ -2503,11 +2486,11 @@ "dev-1.x": "1.x-dev" }, "drupal": { - "version": "8.x-1.4", + "version": "8.x-1.4+1-dev", "datestamp": "1535556181", "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." } }, "installer-types": [ @@ -2584,21 +2567,16 @@ "homepage": "https://www.drupal.org/project/lightning_layout", "support": { "source": "http://cgit.drupalcode.org/lightning_layout" - } + }, + "time": "2018-08-29T15:20:13+00:00" }, { "name": "drupal/lightning_media", - "version": "2.4.0", + "version": "dev-3.x", "source": { "type": "git", "url": "https://git.drupal.org/project/lightning_media", - "reference": "8.x-2.4" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/lightning_media-8.x-2.4.zip", - "reference": "8.x-2.4", - "shasum": "bf6300915d472791b18326bb414d457f1e12e4e4" + "reference": "053a51f879d6d7c871102205576b298a4da6fab2" }, "require": { "bower-asset/cropper": "^2.3", @@ -2613,7 +2591,7 @@ "drupal/entity_embed": "1.0.0-beta2", "drupal/image_widget_crop": "^2.1", "drupal/inline_entity_form": "^1.0", - "drupal/lightning_core": "^2.9", + "drupal/lightning_core": "3.x-dev", "drupal/media": "*", "drupal/media_entity_instagram": "2.0.0-alpha1", "drupal/media_entity_twitter": "2.0.0-alpha2", @@ -2631,14 +2609,14 @@ "type": "drupal-module", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-3.x": "3.x-dev" }, "drupal": { - "version": "8.x-2.4", - "datestamp": "1535554080", + "version": "8.x-3.0-beta1+11-dev", + "datestamp": "1535543884", "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." } }, "installer-types": [ @@ -2665,10 +2643,6 @@ ] }, "patches": { - "drupal/core": { - "2877383 - Add action support to Media module": "https://www.drupal.org/files/issues/2877383-56.patch", - "2670730 - Provide a delete action for each content entity type": "https://www.drupal.org/files/issues/2670730-81-89-8.5.0-rc1.patch" - }, "drupal/entity_embed": { "2832504 - Send the CKEditor instance ID to the embed.preview route": "https://www.drupal.org/files/issues/2832504-2.patch" }, @@ -2722,28 +2696,23 @@ "homepage": "https://www.drupal.org/project/lightning_media", "support": { "source": "http://cgit.drupalcode.org/lightning_media" - } + }, + "time": "2018-08-30T14:57:00+00:00" }, { "name": "drupal/lightning_workflow", - "version": "2.4.0", + "version": "dev-3.x", "source": { "type": "git", "url": "https://git.drupal.org/project/lightning_workflow", - "reference": "8.x-2.4" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/lightning_workflow-8.x-2.4.zip", - "reference": "8.x-2.4", - "shasum": "7b8349af7a06c1f8134720badb4e2a3bf61e0f33" + "reference": "a52e2a848b4fd8c139ef58f18c9fc3203dac6b85" }, "require": { "cweagans/composer-patches": "^1.6.4", "drupal-composer/drupal-scaffold": "^2.0.0", "drupal/core": "*", "drupal/diff": "^1.0", - "drupal/lightning_core": "^2.9", + "drupal/lightning_core": "3.x-dev", "drupal/moderation_sidebar": "^1.0", "oomphinc/composer-installers-extender": "^1.1" }, @@ -2757,14 +2726,14 @@ "type": "drupal-module", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-3.x": "3.x-dev" }, "drupal": { - "version": "8.x-2.4", - "datestamp": "1535737980", + "version": "8.x-3.0-beta2+13-dev", + "datestamp": "1535736480", "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." } }, "installer-types": [ @@ -2790,11 +2759,6 @@ "type:drupal-theme" ] }, - "patches": { - "drupal/core": { - "2945571 - Off canvas looks funky when using Seven theme": "https://www.drupal.org/files/issues/2018-08-22/off-canvas-2945571-19.patch" - } - }, "enable-patching": true }, "notification-url": "https://packages.drupal.org/8/downloads", @@ -2837,7 +2801,8 @@ "homepage": "https://www.drupal.org/project/lightning_workflow", "support": { "source": "http://cgit.drupalcode.org/lightning_workflow" - } + }, + "time": "2018-08-31T17:23:57+00:00" }, { "name": "drupal/media_entity_instagram", @@ -3773,7 +3738,7 @@ }, "drupal": { "version": "8.x-1.0-alpha3", - "datestamp": "1521868984", + "datestamp": "1521869040", "security-coverage": { "status": "not-covered", "message": "Alpha releases are not covered by Drupal security advisories." @@ -3793,6 +3758,10 @@ "name": "HalfChem", "homepage": "https://www.drupal.org/user/1608382" }, + { + "name": "e0ipso", + "homepage": "https://www.drupal.org/user/550110" + }, { "name": "febbraro", "homepage": "https://www.drupal.org/user/43670" @@ -3802,12 +3771,12 @@ "homepage": "https://www.drupal.org/user/208732" }, { - "name": "pcho", - "homepage": "https://www.drupal.org/user/1619590" + "name": "mpotter", + "homepage": "https://www.drupal.org/user/616192" }, { - "name": "srjosh", - "homepage": "https://www.drupal.org/user/165878" + "name": "richgerdes", + "homepage": "https://www.drupal.org/user/3437973" }, { "name": "tekante", @@ -11789,6 +11758,11 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "drupal/lightning_api": 20, + "drupal/lightning_core": 20, + "drupal/lightning_layout": 20, + "drupal/lightning_media": 20, + "drupal/lightning_workflow": 20, "drupal/media_entity_generic": 20, "acquia/lightning_dev": 20 }, diff --git a/drupal-org-core.make b/drupal-org-core.make index 806f41676..9d42a0ecf 100644 --- a/drupal-org-core.make +++ b/drupal-org-core.make @@ -3,14 +3,9 @@ api = 2 projects[drupal][type] = core projects[drupal][download][type] = git projects[drupal][download][url] = https://git.drupal.org/project/drupal.git -projects[drupal][download][branch] = 8.5.x -projects[drupal][download][tag] = 8.5.6 -projects[drupal][patch][] = https://www.drupal.org/files/issues/1356278-408--8.5.x-real.patch -projects[drupal][patch][] = https://www.drupal.org/files/issues/2880374-remove-experimental-warnings-6.patch +projects[drupal][download][branch] = 8.6.x projects[drupal][patch][] = https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch projects[drupal][patch][] = https://www.drupal.org/files/issues/2885441-2.patch -projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-06-07/2815221-102.patch -projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-07-04/2921661-86-8.6.x.patch -projects[drupal][patch][] = https://www.drupal.org/files/issues/2877383-56.patch -projects[drupal][patch][] = https://www.drupal.org/files/issues/2670730-81-89-8.5.0-rc1.patch -projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-08-22/off-canvas-2945571-19.patch \ No newline at end of file +projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-07-09/2815221-105.patch +projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-07-12/1356276-473.patch +projects[drupal][patch][] = https://www.drupal.org/files/issues/2018-07-09/2914389-8-do-not-test.patch \ No newline at end of file diff --git a/drupal-org.make b/drupal-org.make index 7bb637a0a..0914dfac7 100644 --- a/drupal-org.make +++ b/drupal-org.make @@ -33,15 +33,30 @@ projects[inline_entity_form][version] = 1.0-rc1 projects[jsonapi][type] = module projects[jsonapi][version] = 1.23 projects[lightning_api][type] = module -projects[lightning_api][version] = 2.7 +projects[lightning_api][download][type] = git +projects[lightning_api][download][url] = https://git.drupal.org/project/lightning_api +projects[lightning_api][download][branch] = 2.x +projects[lightning_api][download][revision] = e7df70ae662305605b06ba73aad9d8e2bc6d0f83 projects[lightning_core][type] = module -projects[lightning_core][version] = 2.9 +projects[lightning_core][download][type] = git +projects[lightning_core][download][url] = https://git.drupal.org/project/lightning_core +projects[lightning_core][download][branch] = 3.x +projects[lightning_core][download][revision] = acd3f6bd16caba7fc8daefd41bdb66ca42e19255 projects[lightning_layout][type] = module -projects[lightning_layout][version] = 1.4 +projects[lightning_layout][download][type] = git +projects[lightning_layout][download][url] = https://git.drupal.org/project/lightning_layout +projects[lightning_layout][download][branch] = 1.x +projects[lightning_layout][download][revision] = f16a2fa0be8f15c8577485d0f1814a8b8c27d791 projects[lightning_media][type] = module -projects[lightning_media][version] = 2.4 +projects[lightning_media][download][type] = git +projects[lightning_media][download][url] = https://git.drupal.org/project/lightning_media +projects[lightning_media][download][branch] = 3.x +projects[lightning_media][download][revision] = 053a51f879d6d7c871102205576b298a4da6fab2 projects[lightning_workflow][type] = module -projects[lightning_workflow][version] = 2.4 +projects[lightning_workflow][download][type] = git +projects[lightning_workflow][download][url] = https://git.drupal.org/project/lightning_workflow +projects[lightning_workflow][download][branch] = 3.x +projects[lightning_workflow][download][revision] = a52e2a848b4fd8c139ef58f18c9fc3203dac6b85 projects[media_entity_instagram][type] = module projects[media_entity_instagram][patch][] = https://www.drupal.org/files/issues/2917454-2.patch projects[media_entity_instagram][version] = 2.0-alpha1 diff --git a/lightning.info.yml b/lightning.info.yml index 839aa0aa5..1e6d3b454 100644 --- a/lightning.info.yml +++ b/lightning.info.yml @@ -5,7 +5,7 @@ description: 'A fast and feature-rich Drupal distribution.' version: '8.x-3.x-dev' distribution: name: Lightning -dependencies: +install: - block_content - breakpoint - ckeditor @@ -61,4 +61,4 @@ themes: - bartik - seven project: lightning -datestamp: '1535742343' +datestamp: '1533732973' diff --git a/lightning.install b/lightning.install index 4906e59a8..fd926e782 100644 --- a/lightning.install +++ b/lightning.install @@ -8,445 +8,6 @@ use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\field\Entity\FieldConfig; use Drupal\lightning_core\ConfigHelper as Config; -use Drupal\user\Entity\User; -use Drupal\user\RoleInterface; - -/** - * Implements hook_install(). - * - * Perform actions to set up the site for Lightning Profile. - * - * @see system_install() - */ -function lightning_install() { - // Assign user 1 the "administrator" role. - $user = User::load(1); - $user->roles[] = 'administrator'; - $user->save(); - - // Don't do anything else during config sync. - if (\Drupal::isConfigSyncing()) { - return; - } - - // Set front page to "node". - \Drupal::configFactory() - ->getEditable('system.site') - ->set('page.front', '/node') - ->save(TRUE); - - // Restrict user registration to admin role creation. - \Drupal::configFactory() - ->getEditable('user.settings') - ->set('register', USER_REGISTER_ADMINISTRATORS_ONLY) - ->save(TRUE); - - // Allow authenticated users to use shortcuts. - user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access shortcuts']); - - // Set the default and admin theme. - \Drupal::configFactory() - ->getEditable('system.theme') - ->set('default', 'bartik') - ->set('admin', 'seven') - ->save(TRUE); - - // Enable the admin theme. - \Drupal::configFactory() - ->getEditable('node.settings') - ->set('use_admin_theme', TRUE) - ->save(TRUE); - - // Set the path to the logo, favicon and README file based on install - // directory. - $lightning_path = drupal_get_path('profile', 'lightning'); - \Drupal::configFactory() - ->getEditable('system.theme.global') - ->set('logo', [ - 'path' => $lightning_path . '/lightning.png', - 'url' => '', - 'use_default' => FALSE, - ]) - ->set('favicon', [ - 'mimetype' => 'image/vnd.microsoft.icon', - 'path' => $lightning_path . '/favicon.ico', - 'url' => '', - 'use_default' => FALSE, - ]) - ->save(TRUE); - - // View display definition. - $display = [ - 'default' => [ - 'display_options' => [ - 'access' => [ - 'type' => 'perm', - 'options' => [ - 'perm' => 'access content', - ], - ], - 'cache' => [ - 'type' => 'tag', - 'options' => [], - ], - 'empty' => [ - 'area_text_custom' => [ - 'id' => 'area_text_custom', - 'table' => 'views', - 'field' => 'area_text_custom', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'empty' => TRUE, - 'tokenize' => TRUE, - 'content' => '

Welcome to [site:name]. No front page content has been created yet.

Would you like to view the README?

', - 'label' => '', - 'plugin_id' => 'text_custom', - ], - 'node_listing_empty' => [ - 'admin_label' => '', - 'empty' => TRUE, - 'field' => 'node_listing_empty', - 'group_type' => 'group', - 'id' => 'node_listing_empty', - 'label' => '', - 'relationship' => 'none', - 'table' => 'node', - 'plugin_id' => 'node_listing_empty', - 'entity_type' => 'node', - ], - 'title' => [ - 'id' => 'title', - 'table' => 'views', - 'field' => 'title', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'label' => '', - 'empty' => TRUE, - 'title' => 'Welcome to [site:name]', - 'plugin_id' => 'title', - ], - ], - 'exposed_form' => [ - 'type' => 'basic', - 'options' => [ - 'submit_button' => 'Apply', - 'reset_button' => FALSE, - 'reset_button_label' => 'Reset', - 'exposed_sorts_label' => 'Sort by', - 'expose_sort_order' => TRUE, - 'sort_asc_label' => 'Asc', - 'sort_desc_label' => 'Desc', - ], - ], - 'filters' => [ - 'promote' => [ - 'admin_label' => '', - 'expose' => [ - 'description' => '', - 'identifier' => '', - 'label' => '', - 'multiple' => FALSE, - 'operator' => '', - 'operator_id' => '', - 'remember' => FALSE, - 'remember_roles' => [ - 'authenticated' => 'authenticated', - ], - 'required' => FALSE, - 'use_operator' => FALSE, - ], - 'exposed' => FALSE, - 'field' => 'promote', - 'group' => 1, - 'group_info' => [ - 'default_group' => 'All', - 'default_group_multiple' => [], - 'description' => '', - 'group_items' => [], - 'identifier' => '', - 'label' => '', - 'multiple' => FALSE, - 'optional' => TRUE, - 'remember' => FALSE, - 'widget' => 'select', - ], - 'group_type' => 'group', - 'id' => 'promote', - 'is_grouped' => FALSE, - 'operator' => '=', - 'relationship' => 'none', - 'table' => 'node_field_data', - 'value' => '1', - 'plugin_id' => 'boolean', - 'entity_type' => 'node', - 'entity_field' => 'promote', - ], - 'status' => [ - 'expose' => [ - 'operator' => '', - ], - 'field' => 'status', - 'group' => 1, - 'id' => 'status', - 'table' => 'node_field_data', - 'value' => 'true', - 'plugin_id' => 'boolean', - 'entity_type' => 'node', - 'entity_field' => 'status', - ], - 'langcode' => [ - 'id' => 'langcode', - 'table' => 'node_field_data', - 'field' => 'langcode', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'operator' => 'in', - 'value' => [ - '***LANGUAGE_language_content***' => '***LANGUAGE_language_content***', - ], - 'group' => 1, - 'exposed' => FALSE, - 'expose' => [ - 'operator_id' => '', - 'label' => '', - 'description' => '', - 'use_operator' => FALSE, - 'operator' => '', - 'identifier' => '', - 'required' => FALSE, - 'remember' => FALSE, - 'multiple' => FALSE, - 'remember_roles' => [ - 'authenticated' => 'authenticated', - ], - 'reduce' => FALSE, - ], - 'is_grouped' => FALSE, - 'group_info' => [ - 'label' => '', - 'description' => '', - 'identifier' => '', - 'optional' => TRUE, - 'widget' => 'select', - 'multiple' => FALSE, - 'remember' => FALSE, - 'default_group' => 'All', - 'default_group_multiple' => [], - 'group_items' => [], - ], - 'plugin_id' => 'language', - 'entity_type' => 'node', - 'entity_field' => 'langcode', - ], - ], - 'pager' => [ - 'type' => 'full', - 'options' => [ - 'items_per_page' => 10, - 'offset' => 0, - 'id' => 0, - 'total_pages' => 0, - 'expose' => [ - 'items_per_page' => FALSE, - 'items_per_page_label' => 'Items per page', - 'items_per_page_options' => '5, 10, 25, 50', - 'items_per_page_options_all' => FALSE, - 'items_per_page_options_all_label' => '- All -', - 'offset' => FALSE, - 'offset_label' => 'Offset', - ], - 'tags' => [ - 'previous' => '‹ Previous', - 'next' => 'Next ›', - 'first' => '« First', - 'last' => 'Last »', - ], - 'quantity' => 9, - ], - ], - 'query' => [ - 'type' => 'views_query', - 'options' => [ - 'disable_sql_rewrite' => FALSE, - 'distinct' => FALSE, - 'replica' => FALSE, - 'query_comment' => '', - 'query_tags' => [], - ], - ], - 'row' => [ - 'type' => 'entity:node', - 'options' => [ - 'view_mode' => 'teaser', - ], - ], - 'sorts' => [ - 'sticky' => [ - 'admin_label' => '', - 'expose' => [ - 'label' => '', - ], - 'exposed' => FALSE, - 'field' => 'sticky', - 'group_type' => 'group', - 'id' => 'sticky', - 'order' => 'DESC', - 'relationship' => 'none', - 'table' => 'node_field_data', - 'plugin_id' => 'boolean', - 'entity_type' => 'node', - 'entity_field' => 'sticky', - ], - 'created' => [ - 'field' => 'created', - 'id' => 'created', - 'order' => 'DESC', - 'table' => 'node_field_data', - 'plugin_id' => 'date', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'exposed' => FALSE, - 'expose' => [ - 'label' => '', - ], - 'granularity' => 'second', - 'entity_type' => 'node', - 'entity_field' => 'created', - ], - ], - 'style' => [ - 'type' => 'default', - 'options' => [ - 'grouping' => [], - 'row_class' => '', - 'default_row_class' => TRUE, - 'uses_fields' => FALSE, - ], - ], - 'title' => '', - 'header' => [], - 'footer' => [], - 'relationships' => [], - 'fields' => [], - 'arguments' => [], - 'display_extenders' => [], - ], - 'display_plugin' => 'default', - 'display_title' => 'Master', - 'id' => 'default', - 'position' => 0, - 'cache_metadata' => [ - 'contexts' => [ - 'languages:language_interface', - 'url.query_args', - 'user.node_grants:view', - 'user.permissions', - ], - 'max-age' => -1, - 'tags' => [], - ], - ], - 'feed_1' => [ - 'display_plugin' => 'feed', - 'id' => 'feed_1', - 'display_title' => 'Feed', - 'position' => 2, - 'display_options' => [ - 'sitename_title' => TRUE, - 'path' => 'rss.xml', - 'displays' => [ - 'page_1' => 'page_1', - 'default' => '', - ], - 'pager' => [ - 'type' => 'some', - 'options' => [ - 'items_per_page' => 10, - 'offset' => 0, - ], - ], - 'style' => [ - 'type' => 'rss', - 'options' => [ - 'description' => '', - 'grouping' => [], - 'uses_fields' => FALSE, - ], - ], - 'row' => [ - 'type' => 'node_rss', - 'options' => [ - 'relationship' => 'none', - 'view_mode' => 'rss', - ], - ], - 'display_extenders' => [], - ], - 'cache_metadata' => [ - 'contexts' => [ - 'languages:language_interface', - 'user.node_grants:view', - 'user.permissions', - ], - 'max-age' => -1, - 'tags' => [], - ], - ], - 'page_1' => [ - 'display_options' => [ - 'path' => 'node', - 'display_extenders' => [], - ], - 'display_plugin' => 'page', - 'display_title' => 'Page', - 'id' => 'page_1', - 'position' => 1, - 'cache_metadata' => [ - 'contexts' => [ - 'languages:language_interface', - 'url.query_args', - 'user.node_grants:view', - 'user.permissions', - ], - 'max-age' => -1, - 'tags' => [], - ], - ], - ]; - - \Drupal::configFactory() - ->getEditable('views.view.frontpage') - ->set('langcode', 'en') - ->set('status', TRUE) - ->set('dependencies', [ - 'config' => [ - 'core.entity_view_mode.node.rss', - 'core.entity_view_mode.node.teaser', - ], - 'module' => [ - 'node', - 'user', - ], - ]) - ->set('id', 'frontpage') - ->set('label', 'Frontpage') - ->set('module', 'node') - ->set('description', 'All content promoted to frontpage') - ->set('tag', 'default') - ->set('base_table', 'node_field_data') - ->set('base_field', 'nid') - ->set('core', '8.x') - ->set('display', [ - 'default' => $display['default'], - 'feed_1' => $display['feed_1'], - 'page_1' => $display['page_1'], - ]) - ->save(TRUE); -} /** * Makes updates to some basic config that ships with Lightning. @@ -538,6 +99,14 @@ function lightning_update_8006() { */ function lightning_update_dependencies() { return [ + 'lightning_dev' => [ + // Lightning Dev 8010 invokes hook_modules_installed() on all modules, so + // Lightning API must ensure the correct OpenAPI modules are installed + // before that happens. + 8010 => [ + 'lightning_api' => 8300, + ], + ], 'media_entity' => [ // Lightning 8004 must run before Media Entity 8002. 8002 => [ diff --git a/lightning.profile b/lightning.profile index 1ae078e1b..b58c3e81d 100644 --- a/lightning.profile +++ b/lightning.profile @@ -9,6 +9,478 @@ use Drupal\lightning_core\ConfigHelper as Config; use Drupal\node\Entity\NodeType; use Drupal\user\RoleInterface; +/** + * Implements hook_install_tasks(). + */ +function lightning_install_tasks() { + $tasks = []; + + $tasks['lightning_prepare_administrator'] = []; + $tasks['lightning_set_front_page'] = []; + $tasks['lightning_disallow_free_registration'] = []; + $tasks['lightning_grant_shortcut_access'] = []; + $tasks['lightning_set_default_theme'] = []; + $tasks['lightning_set_logo'] = []; + $tasks['lightning_alter_frontpage_view'] = []; + + return $tasks; +} + +/** + * Assigns the 'administrator' role to user 1. + */ +function lightning_prepare_administrator() { + /** @var \Drupal\user\UserInterface $account */ + $account = entity_load('user', 1); + if ($account) { + $account->addRole('administrator'); + $account->save(); + } +} + +/** + * Sets the front page path to /node. + */ +function lightning_set_front_page() { + if (Drupal::moduleHandler()->moduleExists('node')) { + Drupal::configFactory() + ->getEditable('system.site') + ->set('page.front', '/node') + ->save(TRUE); + } +} + +/** + * Only allows administrators to create new user accounts. + */ +function lightning_disallow_free_registration() { + Drupal::configFactory() + ->getEditable('user.settings') + ->set('register', USER_REGISTER_ADMINISTRATORS_ONLY) + ->save(TRUE); +} + +/** + * Allows authenticated users to use shortcuts. + */ +function lightning_grant_shortcut_access() { + if (Drupal::moduleHandler()->moduleExists('shortcut')) { + user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access shortcuts']); + } +} + +/** + * Sets the default and administration themes. + */ +function lightning_set_default_theme() { + Drupal::configFactory() + ->getEditable('system.theme') + ->set('default', 'bartik') + ->set('admin', 'seven') + ->save(TRUE); + + // Use the admin theme for creating content. + if (Drupal::moduleHandler()->moduleExists('node')) { + Drupal::configFactory() + ->getEditable('node.settings') + ->set('use_admin_theme', TRUE) + ->save(TRUE); + } +} + +/** + * Set the path to the logo, favicon and README file based on install directory. + */ +function lightning_set_logo() { + $lightning_path = drupal_get_path('profile', 'lightning'); + + Drupal::configFactory() + ->getEditable('system.theme.global') + ->set('logo', [ + 'path' => $lightning_path . '/lightning.png', + 'url' => '', + 'use_default' => FALSE, + ]) + ->set('favicon', [ + 'mimetype' => 'image/vnd.microsoft.icon', + 'path' => $lightning_path . '/favicon.ico', + 'url' => '', + 'use_default' => FALSE, + ]) + ->save(TRUE); +} + +/** + * Alters the frontpage view, if it exists. + */ +function lightning_alter_frontpage_view() { + $front_page = Drupal::configFactory()->getEditable('views.view.frontpage'); + + if (! $front_page->isNew()) { + $front_page + ->set('langcode', 'en') + ->set('status', TRUE) + ->set('dependencies', [ + 'config' => [ + 'core.entity_view_mode.node.rss', + 'core.entity_view_mode.node.teaser', + ], + 'module' => [ + 'node', + 'user', + ], + ]) + ->set('id', 'frontpage') + ->set('label', 'Frontpage') + ->set('module', 'node') + ->set('description', 'All content promoted to frontpage') + ->set('tag', 'default') + ->set('base_table', 'node_field_data') + ->set('base_field', 'nid') + ->set('core', '8.x') + ->set('display.default', [ + 'display_options' => [ + 'access' => [ + 'type' => 'perm', + 'options' => [ + 'perm' => 'access content', + ], + ], + 'cache' => [ + 'type' => 'tag', + 'options' => [], + ], + 'empty' => [ + 'area_text_custom' => [ + 'id' => 'area_text_custom', + 'table' => 'views', + 'field' => 'area_text_custom', + 'relationship' => 'none', + 'group_type' => 'group', + 'admin_label' => '', + 'empty' => TRUE, + 'tokenize' => TRUE, + 'content' => '

Welcome to [site:name]. No front page content has been created yet.

Would you like to view the README?

', + 'label' => '', + 'plugin_id' => 'text_custom', + ], + 'node_listing_empty' => [ + 'admin_label' => '', + 'empty' => TRUE, + 'field' => 'node_listing_empty', + 'group_type' => 'group', + 'id' => 'node_listing_empty', + 'label' => '', + 'relationship' => 'none', + 'table' => 'node', + 'plugin_id' => 'node_listing_empty', + 'entity_type' => 'node', + ], + 'title' => [ + 'id' => 'title', + 'table' => 'views', + 'field' => 'title', + 'relationship' => 'none', + 'group_type' => 'group', + 'admin_label' => '', + 'label' => '', + 'empty' => TRUE, + 'title' => 'Welcome to [site:name]', + 'plugin_id' => 'title', + ], + ], + 'exposed_form' => [ + 'type' => 'basic', + 'options' => [ + 'submit_button' => 'Apply', + 'reset_button' => FALSE, + 'reset_button_label' => 'Reset', + 'exposed_sorts_label' => 'Sort by', + 'expose_sort_order' => TRUE, + 'sort_asc_label' => 'Asc', + 'sort_desc_label' => 'Desc', + ], + ], + 'filters' => [ + 'promote' => [ + 'admin_label' => '', + 'expose' => [ + 'description' => '', + 'identifier' => '', + 'label' => '', + 'multiple' => FALSE, + 'operator' => '', + 'operator_id' => '', + 'remember' => FALSE, + 'remember_roles' => [ + 'authenticated' => 'authenticated', + ], + 'required' => FALSE, + 'use_operator' => FALSE, + ], + 'exposed' => FALSE, + 'field' => 'promote', + 'group' => 1, + 'group_info' => [ + 'default_group' => 'All', + 'default_group_multiple' => [], + 'description' => '', + 'group_items' => [], + 'identifier' => '', + 'label' => '', + 'multiple' => FALSE, + 'optional' => TRUE, + 'remember' => FALSE, + 'widget' => 'select', + ], + 'group_type' => 'group', + 'id' => 'promote', + 'is_grouped' => FALSE, + 'operator' => '=', + 'relationship' => 'none', + 'table' => 'node_field_data', + 'value' => '1', + 'plugin_id' => 'boolean', + 'entity_type' => 'node', + 'entity_field' => 'promote', + ], + 'status' => [ + 'expose' => [ + 'operator' => '', + ], + 'field' => 'status', + 'group' => 1, + 'id' => 'status', + 'table' => 'node_field_data', + 'value' => 'true', + 'plugin_id' => 'boolean', + 'entity_type' => 'node', + 'entity_field' => 'status', + ], + 'langcode' => [ + 'id' => 'langcode', + 'table' => 'node_field_data', + 'field' => 'langcode', + 'relationship' => 'none', + 'group_type' => 'group', + 'admin_label' => '', + 'operator' => 'in', + 'value' => [ + '***LANGUAGE_language_content***' => '***LANGUAGE_language_content***', + ], + 'group' => 1, + 'exposed' => FALSE, + 'expose' => [ + 'operator_id' => '', + 'label' => '', + 'description' => '', + 'use_operator' => FALSE, + 'operator' => '', + 'identifier' => '', + 'required' => FALSE, + 'remember' => FALSE, + 'multiple' => FALSE, + 'remember_roles' => [ + 'authenticated' => 'authenticated', + ], + 'reduce' => FALSE, + ], + 'is_grouped' => FALSE, + 'group_info' => [ + 'label' => '', + 'description' => '', + 'identifier' => '', + 'optional' => TRUE, + 'widget' => 'select', + 'multiple' => FALSE, + 'remember' => FALSE, + 'default_group' => 'All', + 'default_group_multiple' => [], + 'group_items' => [], + ], + 'plugin_id' => 'language', + 'entity_type' => 'node', + 'entity_field' => 'langcode', + ], + ], + 'pager' => [ + 'type' => 'full', + 'options' => [ + 'items_per_page' => 10, + 'offset' => 0, + 'id' => 0, + 'total_pages' => 0, + 'expose' => [ + 'items_per_page' => FALSE, + 'items_per_page_label' => 'Items per page', + 'items_per_page_options' => '5, 10, 25, 50', + 'items_per_page_options_all' => FALSE, + 'items_per_page_options_all_label' => '- All -', + 'offset' => FALSE, + 'offset_label' => 'Offset', + ], + 'tags' => [ + 'previous' => '‹ Previous', + 'next' => 'Next ›', + 'first' => '« First', + 'last' => 'Last »', + ], + 'quantity' => 9, + ], + ], + 'query' => [ + 'type' => 'views_query', + 'options' => [ + 'disable_sql_rewrite' => FALSE, + 'distinct' => FALSE, + 'replica' => FALSE, + 'query_comment' => '', + 'query_tags' => [], + ], + ], + 'row' => [ + 'type' => 'entity:node', + 'options' => [ + 'view_mode' => 'teaser', + ], + ], + 'sorts' => [ + 'sticky' => [ + 'admin_label' => '', + 'expose' => [ + 'label' => '', + ], + 'exposed' => FALSE, + 'field' => 'sticky', + 'group_type' => 'group', + 'id' => 'sticky', + 'order' => 'DESC', + 'relationship' => 'none', + 'table' => 'node_field_data', + 'plugin_id' => 'boolean', + 'entity_type' => 'node', + 'entity_field' => 'sticky', + ], + 'created' => [ + 'field' => 'created', + 'id' => 'created', + 'order' => 'DESC', + 'table' => 'node_field_data', + 'plugin_id' => 'date', + 'relationship' => 'none', + 'group_type' => 'group', + 'admin_label' => '', + 'exposed' => FALSE, + 'expose' => [ + 'label' => '', + ], + 'granularity' => 'second', + 'entity_type' => 'node', + 'entity_field' => 'created', + ], + ], + 'style' => [ + 'type' => 'default', + 'options' => [ + 'grouping' => [], + 'row_class' => '', + 'default_row_class' => TRUE, + 'uses_fields' => FALSE, + ], + ], + 'title' => '', + 'header' => [], + 'footer' => [], + 'relationships' => [], + 'fields' => [], + 'arguments' => [], + 'display_extenders' => [], + ], + 'display_plugin' => 'default', + 'display_title' => 'Master', + 'id' => 'default', + 'position' => 0, + 'cache_metadata' => [ + 'contexts' => [ + 'languages:language_interface', + 'url.query_args', + 'user.node_grants:view', + 'user.permissions', + ], + 'max-age' => -1, + 'tags' => [], + ], + ]) + ->set('display.feed_1', [ + 'display_plugin' => 'feed', + 'id' => 'feed_1', + 'display_title' => 'Feed', + 'position' => 2, + 'display_options' => [ + 'sitename_title' => TRUE, + 'path' => 'rss.xml', + 'displays' => [ + 'page_1' => 'page_1', + 'default' => '', + ], + 'pager' => [ + 'type' => 'some', + 'options' => [ + 'items_per_page' => 10, + 'offset' => 0, + ], + ], + 'style' => [ + 'type' => 'rss', + 'options' => [ + 'description' => '', + 'grouping' => [], + 'uses_fields' => FALSE, + ], + ], + 'row' => [ + 'type' => 'node_rss', + 'options' => [ + 'relationship' => 'none', + 'view_mode' => 'rss', + ], + ], + 'display_extenders' => [], + ], + 'cache_metadata' => [ + 'contexts' => [ + 'languages:language_interface', + 'user.node_grants:view', + 'user.permissions', + ], + 'max-age' => -1, + 'tags' => [], + ], + ]) + ->set('display.page_1', [ + 'display_options' => [ + 'path' => 'node', + 'display_extenders' => [], + ], + 'display_plugin' => 'page', + 'display_title' => 'Page', + 'id' => 'page_1', + 'position' => 1, + 'cache_metadata' => [ + 'contexts' => [ + 'languages:language_interface', + 'url.query_args', + 'user.node_grants:view', + 'user.permissions', + ], + 'max-age' => -1, + 'tags' => [], + ], + ]) + ->save(TRUE); + } +} + /** * Implements hook_modules_installed(). */ diff --git a/src/Command/SubProfileCommand.php b/src/Command/SubProfileCommand.php index b61f9ac73..fe3ca2ea9 100644 --- a/src/Command/SubProfileCommand.php +++ b/src/Command/SubProfileCommand.php @@ -75,14 +75,14 @@ class SubProfileCommand extends Command { * * @var string[] */ - protected $include = []; + protected $installList = []; /** * Modules to exclude from the sub-profile. * * @var string[] */ - protected $exclude = []; + protected $excludeList = []; /** * Cache of parsed info for Lightning's main components. @@ -189,18 +189,18 @@ protected function initialize(InputInterface $input, OutputInterface $output) { $this->validator->validateMachineName($options['machine-name']); } if ($options['include']) { - $this->include = $this->toArray($options['include']); + $this->installList = $this->toArray($options['include']); } if ($options['exclude']) { // Only Lightning components can be excluded. This prevents wily users // from excluding modules that Lightning needs. - $this->exclude = $this->toArray($options['exclude']); - $this->validateExcludedModules($this->exclude); + $this->excludeList = $this->toArray($options['exclude']); + $this->validateExcludedModules($this->excludeList); // Exclude the sub-components of any excluded components. $excluded_components = array_intersect_key( $this->getMainComponentInfo(), - array_flip($this->exclude) + array_flip($this->excludeList) ); foreach ($excluded_components as $info) { $this->doExclude(@$info['components']); @@ -244,13 +244,13 @@ protected function interact(InputInterface $input, OutputInterface $output) { // Get any included modules from the --include option, or ask the user if // none were specified. - if (empty($this->include)) { + if (empty($this->installList)) { $include = $io->ask( $this->trans('commands.lightning.subprofile.options.include'), NULL, 'trim' ); - $this->include = $this->toArray($include); + $this->installList = $this->toArray($include); } // Ask the user if they want to exclude any Lightning components. @@ -262,7 +262,7 @@ protected function interact(InputInterface $input, OutputInterface $output) { // Ask about components that have not been excluded yet. $available_components = array_diff_key( $this->getMainComponentInfo(), - array_flip($this->exclude) + array_flip($this->excludeList) ); foreach ($available_components as $component => $info) { $info['machine_name'] = $component; @@ -357,8 +357,8 @@ protected function confirmComponent(array $info, DrupalStyle $io) { protected function doExclude($modules) { if ($modules) { $modules = (array) $modules; - $this->exclude = array_merge($this->exclude, $modules); - $this->include = array_diff($this->include, $modules); + $this->excludeList = array_merge($this->excludeList, $modules); + $this->installList = array_diff($this->installList, $modules); } } @@ -412,8 +412,8 @@ protected function execute(InputInterface $input, OutputInterface $output) { $input->getOption('machine-name'), $this->appRoot . '/profiles/custom', $input->getOption('description'), - array_unique($this->include), - array_unique($this->exclude) + array_unique($this->installList), + array_unique($this->excludeList) ); } } diff --git a/src/Generator/SubProfileGenerator.php b/src/Generator/SubProfileGenerator.php index 2648ab42d..4fd4c89d6 100644 --- a/src/Generator/SubProfileGenerator.php +++ b/src/Generator/SubProfileGenerator.php @@ -13,7 +13,8 @@ class SubProfileGenerator extends Generator { /** * {@inheritdoc} */ - public function generate($name, $machine_name, $profile_path, $description, array $dependencies, array $excluded_dependencies) { + public function generate($name, $machine_name, $profile_path, $description, array $install_list, array $exclude_list + ) { $destination = $profile_path . '/' . $machine_name; // If the destination path already exists, realpath() will return something @@ -43,14 +44,7 @@ public function generate($name, $machine_name, $profile_path, $description, arra (new Filesystem)->mkdir($destination); // Recurse to do the entire validation dance again. - $this->generate( - $name, - $machine_name, - $profile_path, - $description, - $dependencies, - $excluded_dependencies - ); + $this->generate($name, $machine_name, $profile_path, $description, $install_list, $exclude_list); return; } @@ -58,8 +52,8 @@ public function generate($name, $machine_name, $profile_path, $description, arra 'profile' => $name, 'machine_name' => $machine_name, 'description' => $description, - 'dependencies' => $dependencies, - 'excluded_dependencies' => $excluded_dependencies, + 'install' => $install_list, + 'exclude' => $exclude_list, ]; $prefix = "$dir/$machine_name"; diff --git a/src/Update/Update320.php b/src/Update/Update320.php new file mode 100644 index 000000000..8d7d2494c --- /dev/null +++ b/src/Update/Update320.php @@ -0,0 +1,130 @@ +appRoot = $app_root; + $this->profileList = $profile_list; + + if ($translation) { + $this->setStringTranslation($translation); + } + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('app.root'), + $container->get('extension.list.profile'), + $container->get('string_translation') + ); + } + + /** + * Converts sub-profile info keys to the 8.6.x API. + * + * @update + * + * @ask Do you want to update all sub-profiles to be Drupal 8.6-compatible? + * + * @param \Symfony\Component\Console\Style\StyleInterface $io + * The I/O handler. + */ + public function updateProfiles(StyleInterface $io) { + $discovery = new ExtensionDiscovery($this->appRoot); + + foreach ($discovery->scan('profile') as $profile) { + $info_file = $profile->getPathname(); + + if (! is_writeable($info_file)) { + $message = $this->t('Cannot write to @path, skipping.', [ + '@path' => $info_file, + ]); + $io->warning((string) $message); + continue; + } + + $info = file_get_contents($info_file); + if (empty($info) || ! strstr($info, 'base profile:')) { + continue; + } + + $info = Yaml::decode($info); + + // 'base profile' must be an array with at least the 'name' key. + if (! isset($info['base profile']['name'])) { + continue; + } + + // Build the list of excluded extensions and themes. + $exclude = []; + if (isset($info['base profile']['excluded_dependencies'])) { + $exclude = array_merge($exclude, $info['base profile']['excluded_dependencies']); + } + if (isset($info['base profile']['excluded_themes'])) { + $exclude = array_merge($exclude, $info['base profile']['excluded_themes']); + } + + $info['base profile'] = $info['base profile']['name']; + if ($exclude) { + $info['exclude'] = $exclude; + } + + $success = file_put_contents($info_file, Yaml::encode($info)); + if ($success) { + $message = $this->t('Updated @profile.', [ + '@profile' => $profile->getName(), + ]); + $io->success((string) $message); + } + else { + throw new \RuntimeException('An error occurred writing to ' . $profile->getPathname()); + } + } + // Reset the cached profile list. + $this->profileList->reset(); + } + +} diff --git a/templates/profile/info.yml.twig b/templates/profile/info.yml.twig index dd4cecea1..f36c97979 100644 --- a/templates/profile/info.yml.twig +++ b/templates/profile/info.yml.twig @@ -5,9 +5,9 @@ version: 8.x-dev description: '{{ description }}' {% endif %} core: '8.x' -{% if dependencies %} -dependencies: -{% for module in dependencies %} +{% if install %} +install: +{% for module in install %} - {{ module }} {% endfor %} {% endif %} @@ -16,11 +16,10 @@ themes: - bartik - seven -base profile: - name: lightning -{% if excluded_dependencies %} - excluded_dependencies: -{% for module in excluded_dependencies %} - - {{ module }} +base profile: lightning +{% if exclude %} +exclude: +{% for module in exclude %} + - {{ module }} {% endfor %} {% endif %} diff --git a/tests/fixtures/3.2.0-beta1.sql.gz b/tests/fixtures/3.2.0-beta1.sql.gz new file mode 100644 index 000000000..626ae2083 Binary files /dev/null and b/tests/fixtures/3.2.0-beta1.sql.gz differ diff --git a/tests/src/Functional/ConfigIntegrityTest.php b/tests/src/Functional/ConfigIntegrityTest.php index a37df43d4..c639272b0 100644 --- a/tests/src/Functional/ConfigIntegrityTest.php +++ b/tests/src/Functional/ConfigIntegrityTest.php @@ -5,6 +5,7 @@ use Drupal\Core\Entity\Entity\EntityViewMode; use Drupal\Tests\BrowserTestBase; use Drupal\user\Entity\Role; +use Drupal\user\UserInterface; use Drupal\workflows\Entity\Workflow; /** @@ -22,6 +23,23 @@ class ConfigIntegrityTest extends BrowserTestBase { public function testConfig() { $assert = $this->assertSession(); + // Assert that all install tasks have done what they should do. + // @see lightning_install_tasks() + $account = entity_load('user', 1); + $this->assertInstanceOf(UserInterface::class, $account); + /** @var UserInterface $account */ + $this->assertTrue($account->hasRole('administrator')); + + $this->assertSame('/node', $this->config('system.site')->get('page.front')); + $this->assertSame(USER_REGISTER_ADMINISTRATORS_ONLY, $this->config('user.settings')->get('register')); + $this->assertTrue(Role::load(Role::AUTHENTICATED_ID)->hasPermission('access shortcuts')); + $this->assertSame('bartik', $this->config('system.theme')->get('default')); + $this->assertSame('seven', $this->config('system.theme')->get('admin')); + $this->assertTrue($this->config('node.settings')->get('use_admin_theme')); + $this->assertContains('/lightning/lightning.png', $this->config('system.theme.global')->get('logo.path')); + $this->assertContains('/lightning/favicon.ico', $this->config('system.theme.global')->get('favicon.path')); + // TODO: Assert changes to the frontpage view were made. + // lightning_core_update_8002() marks a couple of core view modes as // internal. $view_modes = EntityViewMode::loadMultiple(['node.rss', 'node.search_index']); @@ -107,9 +125,6 @@ public function testConfig() { ]); } - $this->doTestCrop(); - $this->doTestContactForm(); - // Assert that bundled content types have meta tags enabled. $this->assertMetatag(['page', 'landing_page']); @@ -244,55 +259,4 @@ protected function assertFilePermissions($permissions, $file) { $this->assertSame($permissions, fileperms($file) & 0777); } - /** - * Tests that cropping is enabled for image media. - */ - private function doTestCrop() { - // Assert that a local copy of the Cropper library is being used. - $settings = $this->config('image_widget_crop.settings')->get('settings'); - $lib = 'libraries/cropper/dist'; - $this->assertContains("$lib/cropper.min.js", $settings['library_url']); - $this->assertContains("$lib/cropper.min.css", $settings['css_url']); - - $form_displays = $this->container - ->get('entity_type.manager') - ->getStorage('entity_form_display') - ->loadByProperties([ - 'targetEntityType' => 'media', - 'bundle' => 'image', - ]); - - /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ - foreach ($form_displays as $form_display) { - $component = $form_display->getComponent('image'); - $this->assertInternalType('array', $component); - $this->assertEquals('image_widget_crop', $component['type']); - $this->assertEquals(['freeform'], $component['settings']['crop_list']); - } - } - - /** - * Tests the site-wide contact form. - */ - private function doTestContactForm() { - $assert = $this->assertSession(); - - $this->assertAllowed('/contact'); - - $assert->fieldExists('Your name'); - $assert->fieldExists('Your email address'); - $assert->fieldExists('Subject'); - $assert->fieldExists('Message'); - - // The name and e-mail fields should not be present for authenticated users. - $account = $this->drupalCreateUser(); - $this->drupalLogin($account); - $this->assertAllowed('/contact'); - $assert->fieldNotExists('Your name'); - $assert->fieldNotExists('Your email address'); - $assert->fieldExists('Subject'); - $assert->fieldExists('Message'); - $this->drupalLogout(); - } - }