-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated dependencies and deployed missing commerce_license via composer
- Loading branch information
1 parent
2d911d5
commit faa128b
Showing
73 changed files
with
5,398 additions
and
194 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
Address | ||
======= | ||
[![Build Status](https://travis-ci.org/bojanz/address.svg?branch=8.x-1.x)](https://travis-ci.org/bojanz/address) | ||
# Address | ||
|
||
Provides functionality for storing, validating and displaying international postal addresses. | ||
The Drupal 8 heir to the addressfield module, powered by the [commerceguys/addressing](https://github.com/commerceguys/addressing) library. | ||
|
||
Installation | ||
------------- | ||
This module needs to be installed via Composer, which will download the required libraries. | ||
|
||
1. Add the Drupal Packagist repository | ||
|
||
```sh | ||
composer config repositories.drupal composer https://packages.drupal.org/8 | ||
``` | ||
This allows Composer to find Address and the other Drupal modules. | ||
|
||
2. Download Address | ||
## Installation | ||
Since the module requires external libraries, Composer or Ludwig must be used. | ||
|
||
### Composer | ||
If your site is [managed via Composer](https://www.drupal.org/node/2718229), use Composer to | ||
download the module, which will also download the required libraries: | ||
```sh | ||
composer require "drupal/address ~1.0" | ||
``` | ||
This will download the latest release of Address. | ||
Use 1.x-dev instead of ~1.0 to get the -dev release instead. | ||
~1.0 downloads the latest release, use 1.x-dev to get the -dev release instead. | ||
Use ```composer update drupal/address --with-dependencies``` to update to a new release. | ||
|
||
### Ludwig | ||
Otherwise, download and install [Ludwig](https://www.drupal.org/project/ludwig) which will allow you | ||
to download the libraries separately: | ||
1) Download Address into your modules folder. | ||
2) Use one of Ludwig's methods to download libraries: | ||
|
||
a) Run the ```ludwig:download``` Drupal Console command or the ```ludwig-download``` Drush command. | ||
|
||
b) Go to ```/admin/reports/packages``` and download each library manually, then place them under address/lib as specified. | ||
|
||
3) Enable Address. | ||
|
||
See https://www.drupal.org/node/2404989 for more information. | ||
Note that when using Ludwig, updating the module will require re-downloading the libraries. | ||
Composer is recommended whenever possible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docroot/modules/contrib/address/src/Plugin/migrate/field/AddressField.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Drupal\address\Plugin\migrate\field; | ||
|
||
use Drupal\migrate\Plugin\MigrationInterface; | ||
use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase; | ||
|
||
/** | ||
* @MigrateField( | ||
* id = "addressfield", | ||
* core = {7}, | ||
* type_map = { | ||
* "addressfield" = "address" | ||
* }, | ||
* source_module = "addressfield", | ||
* destination_module = "address" | ||
* ) | ||
*/ | ||
class AddressField extends FieldPluginBase { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFieldFormatterMap() { | ||
return [ | ||
'addressfield_default' => 'address_default', | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFieldWidgetMap() { | ||
return [ | ||
'addressfield_standard' => 'address_default', | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function processFieldValues(MigrationInterface $migration, $field_name, $data) { | ||
$process = [ | ||
'plugin' => 'addressfield', | ||
'source' => $field_name, | ||
]; | ||
$migration->mergeProcessOfProperty($field_name, $process); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
docroot/modules/contrib/address/tests/src/Kernel/Plugin/migrate/field/AddressFieldTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Drupal\Tests\address\Kernel\Plugin\migrate\field; | ||
|
||
use Drupal\address\Plugin\migrate\field\AddressField; | ||
use Drupal\address\Plugin\migrate\cckfield\AddressField as CckAddressField; | ||
use Drupal\KernelTests\KernelTestBase; | ||
use Drupal\migrate\Plugin\MigrationInterface; | ||
|
||
/** | ||
* Tests the address field field plugin. | ||
* | ||
* @group address | ||
*/ | ||
class AddressFieldTest extends KernelTestBase { | ||
|
||
/** | ||
* Modules to enable. | ||
* | ||
* @var array | ||
*/ | ||
public static $modules = [ | ||
'address', | ||
'migrate', | ||
'migrate_drupal', | ||
]; | ||
|
||
/** | ||
* Tests discovery of the field plugin. | ||
*/ | ||
public function testPlugin() { | ||
$migration = $this->prophesize(MigrationInterface::class)->reveal(); | ||
$field_plugin_manager = $this->container->get('plugin.manager.migrate.field'); | ||
$definition = $field_plugin_manager->getDefinition('addressfield'); | ||
$this->assertNotEmpty($definition); | ||
$field_plugin = $field_plugin_manager->createInstance('addressfield', [], $migration); | ||
$this->assertInstanceOf(AddressField::class, $field_plugin); | ||
} | ||
|
||
/** | ||
* Tests discovery of the cck field plugin. | ||
*/ | ||
public function testLegacyPlugin() { | ||
$migration = $this->prophesize(MigrationInterface::class)->reveal(); | ||
$cck_plugin_manager = $this->container->get('plugin.manager.migrate.cckfield'); | ||
$definition = $cck_plugin_manager->getDefinition('addressfield'); | ||
$this->assertNotEmpty($definition); | ||
$cck_plugin = $cck_plugin_manager->createInstance('addressfield', [], $migration); | ||
$this->assertInstanceOf(CckAddressField::class, $cck_plugin); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
INTRODUCTION | ||
------------ | ||
|
||
The Commerce License allows the creation of products that sell access to some | ||
aspect of the site. This could be a role, publication of a node, and so on. | ||
|
||
This access is controlled by a License entity, which is created for the user | ||
when the product is purchased. | ||
|
||
The nature of what a License entity grants is handled by License type plugins. | ||
Each License entity will have one License type plugin associated with it. | ||
|
||
A product variation that sells a License will have a configured License type | ||
plugin field value. This acts as template to create the License when a user | ||
purchases that product variation. | ||
|
||
REQUIREMENTS | ||
------------ | ||
|
||
This module requires the following modules: | ||
|
||
* Commerce (https://drupal.org/project/commerce) | ||
* Recurring Period (https://drupal.org/project/recurring_period) |
Oops, something went wrong.