Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Update dkan to 1.13.5 (#376)
Browse files Browse the repository at this point in the history
* Do not skip stage file proxy if set.

* Update dkan to 1.13.5

* Update dkan.
  • Loading branch information
nucivicmachine authored and dkinzer committed Jul 18, 2017
1 parent 35b9bd1 commit 4e09b6b
Show file tree
Hide file tree
Showing 101 changed files with 875 additions and 402 deletions.
12 changes: 5 additions & 7 deletions assets/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,11 @@ function _data_starter_validates($variable = '') {
switch (ENVIRONMENT) {
case 'local':
if (_data_starter_validates('stage_file_proxy_origin')) {
if ($conf['default']['stage_file_proxy']) {
$conf['features_master_temp_enabled_modules'] = array_merge(
$conf['features_master_temp_enabled_modules'],
array(
'stage_file_proxy',
));
}
$conf['features_master_temp_enabled_modules'] = array_merge(
$conf['features_master_temp_enabled_modules'],
array(
'stage_file_proxy',
));
}

// Features Master also supports temporarily disabling modules.
Expand Down
2 changes: 2 additions & 0 deletions build-dkan.make
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ projects[dkan][type] = profile
projects[dkan][download][type] = git
projects[dkan][download][url] = https://github.com/NuCivic/dkan.git
projects[dkan][download][tag] = 7.x-1.13.5

projects[dkan][patch][] = https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/2012.diff
3 changes: 3 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
'circle' =>
array (
'memory_limit' => '256M',
'skip_features' =>
array (
),
'skip_tags' =>
array (
0 => 'customizable',
Expand Down
2 changes: 1 addition & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ acquia:
derived_key: changeme
circle:
memory_limit: 256M
skip_features: []
skip_tags:
- customizable
- fixme
- testBug
skip_features: []
test_dirs:
- tests/features
- dkan/test/features
Expand Down
14 changes: 12 additions & 2 deletions dkan/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
7.x-1.13.5
----------
- #2003 Fix dkan_bueditor_markdown_install(), which was using a variable before it was initialized.
- #2003 Fix to dkan_update_7016, which assumed the bueditor ID was always '5' and failed when it was not.
- #2003 Fix dkan_topics_field_formatter_view(), which does not check if a term exists before calling it by tid.
- #2003 Make Harvest tests clean up after themselves more completely (resources, other nodes were not being cleared).
- #2003 Fix issues with registering/deregistering and rolling back default content migrations on install/uninstall.
- #2003 Fix dkan_migrate_base warning: wrong type supplied to foreach.
- #1963 Allow Behat dkanExtension to handle custom fields via devel generate
- #1938 Allow skipping of features test via config
- #1970 Automatically populate required fields when running behat tests.

7.x-1.13.4
----------
- #1970 DevOps: Automatically populate required fields when running behat tests.
- #1938 DevOps: Allow behat tests to be skipped in circle.
- #1983 Apply services security update 3.20 for DRUPAL-SA-CONTRIB-2017-054
- #1877 Fix broken update that tries to migrate fields that may not exist (primarily due to Federal Extras upgrade)
- #1960 Update field_group_table to 1.6
Expand Down
4 changes: 0 additions & 4 deletions dkan/PATCHES.txt

This file was deleted.

4 changes: 2 additions & 2 deletions dkan/dkan.info
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ dependencies[] = dkan_datastore_api
dependencies[] = open_data_schema_map_dkan
dependencies[] = visualization_entity_charts_dkan

; Information added by DKAN release script on 6/30/2017
version = 7.x-1.13.4
; Information added by DKAN release script on 7/14/2017
version = 7.x-1.13.5
project = dkan
22 changes: 22 additions & 0 deletions dkan/dkan.install
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,25 @@ function dkan_update_7020() {
variable_set('chosen_jquery_selector',
'.page-node select:not([class*="delta-order"], [name*="workbench_moderation"], [class*="filter-list"], [id*="delimiter"],[name*="sort_by"],[name*="sort_order"], [id*="lines-terminated-by"])');
}

/**
* Add data dictionary textarea id to bueditor excludes list.
*
* This is similar to 'dkan_update_7016' but loading the ID from the DB first.
*/
function dkan_update_7021() {
$eid = db_select("bueditor_editors", "bue")
->fields("bue", array("eid"))
->condition("name", "Markdowneditor")
->execute()
->fetchField();

db_update('bueditor_editors')
->fields(array(
'excludes' => 'edit-log
edit-menu-description
*data-dictionary*',
))
->condition('eid', $eid)
->execute();
}
8 changes: 5 additions & 3 deletions dkan/dkan.profile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ function dkan_markdown_setup(array &$context) {
drupal_write_record('bueditor_editors', $data, array('eid'));
// Remove unsupported markdown options.
dkan_delete_markdown_buttons($context);

return $context;
}

/**
Expand Down Expand Up @@ -495,15 +497,15 @@ function dkan_bueditor_markdown_install() {
}
}

variable_set('bueditor_roles', $bueditor_roles);
variable_set('bueditor_user1', $eid);

$eid = db_select("bueditor_editors", "bue")
->fields("bue", array("eid"))
->condition("name", "Markdowneditor")
->execute()
->fetchField();

variable_set('bueditor_roles', $bueditor_roles);
variable_set('bueditor_user1', $eid);

$data = array(
'html' => array('default' => $eid, 'alternative' => 0),
'plain_text' => array('plain_text' => 0, 'alternative' => 0),
Expand Down
12 changes: 12 additions & 0 deletions dkan/docs/releases/notes/1.13.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DKAN 1.13.5

This is a "patch" release of DKAN, containing bug fixes and minor
updates, but adding no new functionality.

## Improvements in this release

This is a small release adressing some minor issues in 1.13.4. The only significant change is the addition of the [devel module](https://www.drupal.org/project/devel) to DKAN core. The devel module is used by almost all Drupal developers to debug, test expiremental code, generate dummy content, and perform other developer tasks. DKAN developers are constantly adding the devel module after building DKAN, and a new set of Behat scenarios added to the test suite need to make use of the dummy content generation functions to pass.

The devel module and its submodules _will_ be disabled by default in DKAN however, and should only be enabled in development environments. Enabling devel in production should be considered a security risk.

All other improvements are minor issues related to installation and tests that arose during deployments of DKAN 1.13.4. Check the CHANGELOG and [Pull Request #2003](https://github.com/NuCivic/dkan/pull/2003) where most of these changes are captured.
10 changes: 5 additions & 5 deletions dkan/drupal-org.make
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ api: '2'
core: 7.x
includes:
- https://raw.githubusercontent.com/NuCivic/visualization_entity/7.x-1.2/visualization_entity.make
- https://raw.githubusercontent.com/NuCivic/open_data_schema_map/7.x-1.13.4/open_data_schema_map.make
- https://raw.githubusercontent.com/NuCivic/open_data_schema_map/7.x-1.13.5/open_data_schema_map.make
- https://raw.githubusercontent.com/NuCivic/leaflet_draw_widget/5a5f8faf664aeca02371f6692307580d9fab9116/leaflet_widget.make
- https://raw.githubusercontent.com/NuCivic/recline/7.x-1.13.4/recline.make
- https://raw.githubusercontent.com/NuCivic/recline/7.x-1.13.5/recline.make
projects:
admin_menu:
version: 3.0-rc5
Expand Down Expand Up @@ -113,7 +113,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/feeds_flatstore_processor.git
revision: 3be870461b80a9709cd30d6ab44578515f97cf4e
revision: 82b2a05bd133dbf870bdf09f1c0a45711f1432e3
field_group:
version: '1.5'
patch:
Expand Down Expand Up @@ -246,7 +246,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/open_data_schema_map.git
tag: 7.x-1.13.4
tag: 7.x-1.13.5
panelizer:
version: '3.4'
panels:
Expand Down Expand Up @@ -276,7 +276,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/recline.git
tag: 7.x-1.13.4
tag: 7.x-1.13.5
ref_field:
download:
type: git
Expand Down
6 changes: 6 additions & 0 deletions dkan/libraries/symfonyserializer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ CHANGELOG
* added an optional `array $context = array()` to `Serializer::supportsNormalization`, `Serializer::supportsDenormalization`,
`Serializer::supportsEncoding` and `Serializer::supportsDecoding`

3.4.0
-----

* added `AbstractObjectNormalizer::DISABLE_TYPE_ENFORCEMENT` context option
to disable throwing an `UnexpectedValueException` on a type mismatch

3.3.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ protected function handleCircularReference($object)
return call_user_func($this->circularReferenceHandler, $object);
}

throw new CircularReferenceException(sprintf('A circular reference has been detected (configured limit: %d).', $this->circularReferenceLimit));
throw new CircularReferenceException(sprintf('A circular reference has been detected when serializing the object of class "%s" (configured limit: %d)', get_class($object), $this->circularReferenceLimit));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Exception\CircularReferenceException;
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
use Symfony\Component\Serializer\Exception\LogicException;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
Expand All @@ -33,6 +32,7 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
const ENABLE_MAX_DEPTH = 'enable_max_depth';
const DEPTH_KEY_PATTERN = 'depth_%s::%s';
const ALLOW_EXTRA_ATTRIBUTES = 'allow_extra_attributes';
const DISABLE_TYPE_ENFORCEMENT = 'disable_type_enforcement';

private $propertyTypeExtractor;
private $attributesCache = array();
Expand All @@ -54,8 +54,6 @@ public function supportsNormalization($data, $format = null)

/**
* {@inheritdoc}
*
* @throws CircularReferenceException
*/
public function normalize($object, $format = null, array $context = array())
{
Expand Down Expand Up @@ -289,6 +287,10 @@ private function validateAndDenormalize($currentClass, $attribute, $data, $forma
}
}

if (!empty($context[self::DISABLE_TYPE_ENFORCEMENT])) {
return $data;
}

throw new UnexpectedValueException(sprintf('The type of the "%s" attribute for class "%s" must be one of "%s" ("%s" given).', $attribute, $currentClass, implode('", "', array_keys($expectedTypes)), gettype($data)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class ArrayDenormalizer implements ContextAwareDenormalizerInterface, Serializer

/**
* {@inheritdoc}
*
* @throws UnexpectedValueException
*/
public function denormalize($data, $class, $format = null, array $context = array())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public function supportsNormalization($data, $format = null)
* Regex adapted from Brian Grinstead code.
*
* @see https://gist.github.com/bgrins/6194623
*
* @throws InvalidArgumentException
* @throws UnexpectedValueException
*/
public function denormalize($data, $class, $format = null, array $context = array())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ public function denormalize($data, $class, $format = null, array $context = arra
$timezone = $this->getTimezone($context);

if (null !== $dateTimeFormat) {
if (null === $timezone && PHP_VERSION_ID < 70000) {
// https://bugs.php.net/bug.php?id=68669
$object = \DateTime::class === $class ? \DateTime::createFromFormat($dateTimeFormat, $data) : \DateTimeImmutable::createFromFormat($dateTimeFormat, $data);
} else {
$object = \DateTime::class === $class ? \DateTime::createFromFormat($dateTimeFormat, $data, $timezone) : \DateTimeImmutable::createFromFormat($dateTimeFormat, $data, $timezone);
}
$object = \DateTime::class === $class ? \DateTime::createFromFormat($dateTimeFormat, $data, $timezone) : \DateTimeImmutable::createFromFormat($dateTimeFormat, $data, $timezone);

if (false !== $object) {
return $object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

namespace Symfony\Component\Serializer\Normalizer;

use Symfony\Component\Serializer\Exception\BadMethodCallException;
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Exception\LogicException;
use Symfony\Component\Serializer\Exception\RuntimeException;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;

/**
* Defines the interface of denormalizers.
*
Expand All @@ -27,6 +34,13 @@ interface DenormalizerInterface
* @param array $context options available to the denormalizer
*
* @return object
*
* @throws BadMethodCallException Occurs when the normalizer is not called in an expected context
* @throws InvalidArgumentException Occurs when the arguments are not coherent or not supported
* @throws UnexpectedValueException Occurs when the item cannot be hydrated with the given data
* @throws ExtraAttributesException Occurs when the item doesn't have attribute to receive given data
* @throws LogicException Occurs when the normalizer is not supposed to denormalize
* @throws RuntimeException Occurs if the class cannot be instantiated
*/
public function denormalize($data, $class, $format = null, array $context = array());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ private function isGetMethod(\ReflectionMethod $method)
!$method->isStatic() &&
(
((0 === strpos($method->name, 'get') && 3 < $methodLength) ||
(0 === strpos($method->name, 'is') && 2 < $methodLength)) &&
(0 === strpos($method->name, 'is') && 2 < $methodLength) ||
(0 === strpos($method->name, 'has') && 3 < $methodLength)) &&
0 === $method->getNumberOfRequiredParameters()
)
;
Expand Down Expand Up @@ -133,6 +134,11 @@ protected function getAttributeValue($object, $attribute, $format = null, array
if (is_callable(array($object, $isser))) {
return $object->$isser();
}

$haser = 'has'.$ucfirsted;
if (is_callable(array($object, $haser))) {
return $object->$haser();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

namespace Symfony\Component\Serializer\Normalizer;

use Symfony\Component\Serializer\Exception\CircularReferenceException;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Exception\LogicException;

/**
* Defines the interface of normalizers.
*
Expand All @@ -26,6 +30,11 @@ interface NormalizerInterface
* @param array $context Context options for the normalizer
*
* @return array|scalar
*
* @throws InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer
* @throws CircularReferenceException Occurs when the normalizer detects a circular reference when no circular
* reference handler can fix it
* @throws LogicException Occurs when the normalizer is not called in an expected context
*/
public function normalize($object, $format = null, array $context = array());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,23 @@ public function testPrivateSetter()
$this->assertEquals('bar', $obj->getFoo());
}

public function testHasGetterDenormalize()
{
$obj = $this->normalizer->denormalize(array('foo' => true), ObjectWithHasGetterDummy::class);
$this->assertTrue($obj->hasFoo());
}

public function testHasGetterNormalize()
{
$obj = new ObjectWithHasGetterDummy();
$obj->setFoo(true);

$this->assertEquals(
array('foo' => true),
$this->normalizer->normalize($obj, 'any')
);
}

public function testMaxDepth()
{
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
Expand Down Expand Up @@ -801,3 +818,18 @@ public static function setFoo($foo)
self::$foo = $foo;
}
}

class ObjectWithHasGetterDummy
{
private $foo;

public function setFoo($foo)
{
$this->foo = $foo;
}

public function hasFoo()
{
return $this->foo;
}
}
Loading

0 comments on commit 4e09b6b

Please sign in to comment.