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

Incorporate install profile work #5

Merged
merged 38 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bfda505
Testing install profile
dannylamb Apr 22, 2021
9311b40
Adding assets and scripts
dannylamb Apr 22, 2021
322f5c4
Removing load.environment.php statement
dannylamb Apr 22, 2021
f0b2297
Trying to get past bootstrap error
dannylamb Apr 22, 2021
1a469b0
Creating README.md
dannylamb Apr 22, 2021
da2be92
Commit to trick buildkit
dannylamb Apr 23, 2021
a0e05b3
Adding config and content sync directories
dannylamb Apr 27, 2021
8a6594d
Adding scripts back in
dannylamb Apr 27, 2021
946a35a
Update composer.json
dannylamb May 6, 2021
363ac12
Update composer.json
dannylamb May 6, 2021
26c0722
Adding demo content
dannylamb May 14, 2021
f89cfbb
chowning content sync directory
dannylamb May 14, 2021
a920f36
Update composer.json
dannylamb May 17, 2021
d1778af
Temporarily set profile dependency to install-profile branch for test…
alxp Oct 27, 2021
260f313
Able to run site-install for a D9 islandora_install_profile_demo.
alxp Oct 28, 2021
28f80f6
Remove local repo reference.
alxp Oct 29, 2021
07a5a6f
Fix repository entry for profile.
alxp Oct 29, 2021
a301d55
D9 upgrades
noahwsmith Nov 2, 2021
9973608
updated composer.lock
noahwsmith Nov 2, 2021
362d748
update composer again
noahwsmith Nov 2, 2021
2b78b2c
updating fits for d9
noahwsmith Nov 2, 2021
f74464f
updating composer.lock
noahwsmith Nov 2, 2021
ee081ca
updating composer.lock
noahwsmith Nov 2, 2021
4ed9546
updating composer.lock
noahwsmith Nov 2, 2021
4deab40
Update composer.lock.
alxp Nov 5, 2021
912ec01
Update composer.lock.
alxp Nov 5, 2021
70c91bd
Update composer.lock
alxp Nov 5, 2021
4ff382f
Updating profile
dannylamb Nov 16, 2021
7ee159b
Touching up dependencies
dannylamb Nov 16, 2021
d4858ef
Add base theme repository.
alxp Nov 18, 2021
b93ab7d
Update composer.lock.
alxp Nov 18, 2021
dea8bb9
Switch to profile branch with dependencies fix.
alxp Nov 18, 2021
429e05d
Switching back to the install-profile branch now that we've pushed th…
dannylamb Nov 19, 2021
845bba1
Update composer.lock
alxp Nov 19, 2021
d78415b
Updating lockfile
dannylamb Nov 22, 2021
67b8e87
Merge branch 'install-profile' of github.com:Islandora-Devops/islando…
dannylamb Nov 22, 2021
baf4803
Update composer.lock for whtie screen fix on new object creation.
alxp Dec 9, 2021
3d57a7a
Update composer.json for main branches and update lock file.
rosiel Dec 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
339 changes: 0 additions & 339 deletions LICENSE

This file was deleted.

144 changes: 1 addition & 143 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,143 +1 @@
# Composer template for Drupal projects

[![Build Status](https://travis-ci.com/Islandora-CLAW/drupal-project.svg?branch=8.x-1.x)](https://travis-ci.com/Islandora-CLAW/drupal-project)

This project template provides a starter kit for managing your site
dependencies with [Composer](https://getcomposer.org/).

If you want to know how to use it as replacement for
[Drush Make](https://github.com/drush-ops/drush/blob/8.x/docs/make.md) visit
the [Documentation on drupal.org](https://www.drupal.org/node/2471553).

## Usage

First you need to [install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).

> Note: The instructions below refer to the [global composer installation](https://getcomposer.org/doc/00-intro.md#globally).
You might need to replace `composer` with `php composer.phar` (or similar)
for your setup.

After that you can create the project:

```
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
```

With `composer require ...` you can download new dependencies to your
installation.

```
cd some-dir
composer require drupal/devel:~1.0
```

The `composer create-project` command passes ownership of all files to the
project that is created. You should create a new git repository, and commit
all files not excluded by the .gitignore file.

## What does the template do?

When installing the given `composer.json` some tasks are taken care of:

* Drupal will be installed in the `web`-directory.
* Autoloader is implemented to use the generated composer autoloader in `vendor/autoload.php`,
instead of the one provided by Drupal (`web/vendor/autoload.php`).
* Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib/`
* Theme (packages of type `drupal-theme`) will be placed in `web/themes/contrib/`
* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib/`
* Creates default writable versions of `settings.php` and `services.yml`.
* Creates `web/sites/default/files`-directory.
* Latest version of drush is installed locally for use at `vendor/bin/drush`.
* Latest version of DrupalConsole is installed locally for use at `vendor/bin/drupal`.
* Creates environment variables based on your .env file. See [.env.example](.env.example).

## Updating Drupal Core

This project will attempt to keep all of your Drupal Core files up-to-date; the
project [drupal-composer/drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold)
is used to ensure that your scaffold files are updated every time drupal/core is
updated. If you customize any of the "scaffolding" files (commonly .htaccess),
you may need to merge conflicts if any of your modified files are updated in a
new release of Drupal core.

Follow the steps below to update your core files.

1. Run `composer update drupal/core webflo/drupal-core-require-dev symfony/* --with-dependencies` to update Drupal Core and its dependencies.
1. Run `git diff` to determine if any of the scaffolding files have changed.
Review the files for any changes and restore any customizations to
`.htaccess` or `robots.txt`.
1. Commit everything all together in a single commit, so `web` will remain in
sync with the `core` when checking out branches or running `git bisect`.
1. In the event that there are non-trivial conflicts in step 2, you may wish
to perform these steps on a branch, and use `git merge` to combine the
updated core files with your customized files. This facilitates the use
of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple;
keeping all of your modifications at the beginning or end of the file is a
good strategy to keep merges easy.

## Generate composer.json from existing project

With using [the "Composer Generate" drush extension](https://www.drupal.org/project/composer_generate)
you can now generate a basic `composer.json` file from an existing project. Note
that the generated `composer.json` might differ from this project's file.


## FAQ

### Should I commit the contrib modules I download?

Composer recommends **no**. They provide [argumentation against but also
workrounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).

### Should I commit the scaffolding files?

The [drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold) plugin can download the scaffold files (like
index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose
to not check them into your version control system (e.g. git). If that is the case for your project it might be
convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can
achieve that by registering `@composer drupal:scaffold` as post-install and post-update command in your composer.json:

```json
"scripts": {
"post-install-cmd": [
"@composer drupal:scaffold",
"..."
],
"post-update-cmd": [
"@composer drupal:scaffold",
"..."
]
},
```
### How can I apply patches to downloaded modules?

If you need to apply patches (depending on the project being modified, a pull
request is often a better solution), you can do so with the
[composer-patches](https://github.com/cweagans/composer-patches) plugin.

To add a patch to drupal module foobar insert the patches section in the extra
section of composer.json:
```json
"extra": {
"patches": {
"drupal/foobar": {
"Patch description": "URL or local path to patch"
}
}
}
```
### How do I switch from packagist.drupal-composer.org to packages.drupal.org?

Follow the instructions in the [documentation on drupal.org](https://www.drupal.org/docs/develop/using-composer/using-packagesdrupalorg).

### How do I specify a PHP version ?

Currently Drupal 8 supports PHP 5.5.9 as minimum version (see [Drupal 8 PHP requirements](https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements)), however it's possible that a `composer update` will upgrade some package that will then require PHP 7+.

To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`:
```json
"config": {
"sort-packages": true,
"platform": {"php": "5.5.9"}
},
```
README
File renamed without changes.
42 changes: 42 additions & 0 deletions assets/patches/features-wsod.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Index: web/modules/contrib/features/src/FeaturesManager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/codebase/web/modules/contrib/features/src/FeaturesManager.php b/codebase/web/modules/contrib/features/src/FeaturesManager.php
--- a/web/modules/contrib/features/src/FeaturesManager.php (date 1613155743839)
+++ b/web/modules/contrib/features/src/FeaturesManager.php (date 1613155743839)
@@ -1224,20 +1224,19 @@
foreach ($config as $item_name => $label) {
$name = $this->getFullName($config_type, $item_name);
$data = $this->configStorage->read($name);
- if ($data) {
- $config_collection[$name] = (new ConfigurationItem($name, $data, [
- 'shortName' => $item_name,
- 'label' => $label,
- 'type' => $config_type,
- 'dependents' => array_keys($dependency_manager->getDependentEntities('config', $name)),
- // Default to the install directory.
- 'subdirectory' => isset($existing_config_by_directory[$name]) ? $existing_config_by_directory[$name] : InstallStorage::CONFIG_INSTALL_DIRECTORY,
- 'package' => '',
- 'providerExcluded' => NULL,
- 'provider' => isset($existing_config[$name]) ? $existing_config[$name] : NULL,
- 'packageExcluded' => [],
- ]));
- }
+
+ $config_collection[$name] = (new ConfigurationItem($name, $data, [
+ 'shortName' => $item_name,
+ 'label' => $label,
+ 'type' => $config_type,
+ 'dependents' => array_keys($dependency_manager->getDependentEntities('config', $name)),
+ // Default to the install directory.
+ 'subdirectory' => isset($existing_config_by_directory[$name]) ? $existing_config_by_directory[$name] : InstallStorage::CONFIG_INSTALL_DIRECTORY,
+ 'package' => '',
+ 'providerExcluded' => NULL,
+ 'provider' => isset($existing_config[$name]) ? $existing_config[$name] : NULL,
+ 'packageExcluded' => [],
+ ]));
}
}
$this->setConfigCollection($config_collection);
19 changes: 19 additions & 0 deletions assets/patches/quicktabs-hide-empty-block-views.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Index: web/modules/contrib/quicktabs/src/Plugin/TabType/BlockContent.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- web/modules/contrib/quicktabs/src/Plugin/TabType/BlockContent.php (date 1605218182192)
+++ web/modules/contrib/quicktabs/src/Plugin/TabType/BlockContent.php (date 1605218182192)
@@ -85,6 +85,11 @@
$render = $plugin_block->build();
}

+ // If this is a view's block and is empty do not render the tab
+ if ($render['#type'] === 'view' && !count($render['#view']->result)) {
+ return [];
+ }
+
return $render;
}

54 changes: 54 additions & 0 deletions assets/patches/tasks-24551727-fixed-mirador-block.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Index: web/modules/contrib/islandora_defaults/modules/islandora_mirador/src/Plugin/Block/MiradorBlock.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- web/modules/contrib/islandora_defaults/modules/islandora_mirador/src/Plugin/Block/MiradorBlock.php (date 1606509418942)
+++ web/modules/contrib/islandora_defaults/modules/islandora_mirador/src/Plugin/Block/MiradorBlock.php (date 1606509418942)
@@ -4,6 +4,7 @@

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Cache\Cache;
+use Drupal\Core\Entity\EntityBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Routing\RouteMatchInterface;
@@ -107,21 +108,23 @@
*/
public function build() {
$node = $this->routeMatch->getParameter('node');
- $manifest_url = $this->token->replace($this->configuration['iiif_manifest_url'], ['node' => $node]);
- $id = 'mirador_' . $node->id();
- $build = [
- "#title" => $this->t('Mirador Viewer'),
- "#description" => $this->t("A div for mirador viewer"),
- "#theme" => "mirador",
- '#mirador_view_id' => $id,
- '#iiif_manifest_url' => $manifest_url,
- "#attached" => [
- 'drupalSettings' => [
- 'iiif_manifest_url' => $manifest_url,
- 'mirador_view_id' => $id,
- ],
- ],
- ];
+ if ($node instanceof EntityBase) {
+ $manifest_url = $this->token->replace($this->configuration['iiif_manifest_url'], ['node' => $node]);
+ $id = 'mirador_' . $node->id();
+ $build = [
+ "#title" => $this->t('Mirador Viewer'),
+ "#description" => $this->t("A div for mirador viewer"),
+ "#theme" => "mirador",
+ '#mirador_view_id' => $id,
+ '#iiif_manifest_url' => $manifest_url,
+ "#attached" => [
+ 'drupalSettings' => [
+ 'iiif_manifest_url' => $manifest_url,
+ 'mirador_view_id' => $id,
+ ]
+ ]
+ ];
+ }

return $build;
}
42 changes: 42 additions & 0 deletions assets/patches/tasks_24551412_-_fixed_features_wsod.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Index: src/FeaturesManager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/FeaturesManager.php b/src/FeaturesManager.php
--- a/src/FeaturesManager.php (revision 6a60f892626b22b7170f8838f0ef82b44a318a68)
+++ b/src/FeaturesManager.php (date 1613158410066)
@@ -1224,19 +1224,20 @@
foreach ($config as $item_name => $label) {
$name = $this->getFullName($config_type, $item_name);
$data = $this->configStorage->read($name);
-
- $config_collection[$name] = (new ConfigurationItem($name, $data, [
- 'shortName' => $item_name,
- 'label' => $label,
- 'type' => $config_type,
- 'dependents' => array_keys($dependency_manager->getDependentEntities('config', $name)),
- // Default to the install directory.
- 'subdirectory' => isset($existing_config_by_directory[$name]) ? $existing_config_by_directory[$name] : InstallStorage::CONFIG_INSTALL_DIRECTORY,
- 'package' => '',
- 'providerExcluded' => NULL,
- 'provider' => isset($existing_config[$name]) ? $existing_config[$name] : NULL,
- 'packageExcluded' => [],
- ]));
+ if ($data) {
+ $config_collection[$name] = (new ConfigurationItem($name, $data, [
+ 'shortName' => $item_name,
+ 'label' => $label,
+ 'type' => $config_type,
+ 'dependents' => array_keys($dependency_manager->getDependentEntities('config', $name)),
+ // Default to the install directory.
+ 'subdirectory' => isset($existing_config_by_directory[$name]) ? $existing_config_by_directory[$name] : InstallStorage::CONFIG_INSTALL_DIRECTORY,
+ 'package' => '',
+ 'providerExcluded' => NULL,
+ 'provider' => isset($existing_config[$name]) ? $existing_config[$name] : NULL,
+ 'packageExcluded' => [],
+ ]));
+ }
}
}
$this->setConfigCollection($config_collection);
Loading