Skip to content

Commit

Permalink
Updated dependencies and deployed missing commerce_license via composer
Browse files Browse the repository at this point in the history
  • Loading branch information
lpalgarvio committed Nov 25, 2017
1 parent 2d911d5 commit faa128b
Show file tree
Hide file tree
Showing 73 changed files with 5,398 additions and 194 deletions.
32 changes: 16 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 22 additions & 18 deletions docroot/modules/contrib/address/README.md
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.
6 changes: 3 additions & 3 deletions docroot/modules/contrib/address/address.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ config: entity.address_format.collection
dependencies:
- drupal:field

# Information added by Drupal.org packaging script on 2017-09-20
version: '8.x-1.2'
# Information added by Drupal.org packaging script on 2017-11-22
version: '8.x-1.3'
core: '8.x'
project: 'address'
datestamp: 1505896147
datestamp: 1511382787
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,33 @@

namespace Drupal\address\Plugin\migrate\cckfield;

@trigger_error('AddressField is deprecated in Address 1.3 and will be be removed before Address 2.x. Use \Drupal\address\Plugin\migrate\field\AddressField instead.', E_USER_DEPRECATED);

use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
use Drupal\address\Plugin\migrate\field\AddressField as BaseAddressField;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface;

/**
* @MigrateCckField(
* id = "addressfield",
* core = {7},
* type_map = {
* "addressfield" = "address"
* }
* },
* source_module = "addressfield",
* destination_module = "address"
* )
*
* @deprecated in 1.3, to be removed before 2.x. Use
* \Drupal\address\Plugin\migrate\field\AddressField instead.
*/
class AddressField extends CckFieldPluginBase {

/**
* {@inheritdoc}
*/
public function getFieldFormatterMap() {
return [
'addressfield_default' => 'address_default',
];
}

/**
* {@inheritdoc}
*/
public function getFieldWidgetMap() {
return [
'addressfield_standard' => 'address_default',
];
}
class AddressField extends BaseAddressField implements MigrateCckFieldInterface {

/**
* {@inheritdoc}
*/
public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'addressfield',
'source' => $field_name,
];
$migration->mergeProcessOfProperty($field_name, $process);
return $this->processFieldValues($migration, $field_name, $data);
}

}
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
- address
- views

# Information added by Drupal.org packaging script on 2017-09-20
version: '8.x-1.2'
# Information added by Drupal.org packaging script on 2017-11-22
version: '8.x-1.3'
core: '8.x'
project: 'address'
datestamp: 1505896147
datestamp: 1511382787
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);
}

}
23 changes: 23 additions & 0 deletions docroot/modules/contrib/commerce_license/README.txt
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)
Loading

0 comments on commit faa128b

Please sign in to comment.