Skip to content

Commit

Permalink
Merge pull request #58 from NuCivic/proposed_release_for_tag_1500065045
Browse files Browse the repository at this point in the history
1500065045: Proposed release for 7.x-1.13.5
  • Loading branch information
MSolv authored Jul 14, 2017
2 parents 8e931eb + cb8e96b commit 3c67a4f
Show file tree
Hide file tree
Showing 195 changed files with 22,339 additions and 491 deletions.
10 changes: 9 additions & 1 deletion profiles/dkan/.ahoy/.scripts/behat-parse-params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Defines helper function for processing behat parameters.
#
require "base64"
require "./dkan/.ahoy/.scripts/config.rb"

def behat_join_params args
args.join(" ").split("--").map do |arg|
Expand Down Expand Up @@ -40,7 +41,14 @@ def behat_parse_params args
puts "Seaching #{param} for feature files..."
# Fetch all of the feature files for each parameter (directories)
if Dir.exist? param
Dir.glob("#{param}/*.feature") {|f| files.push f}
Dir.glob("#{param}/*.feature") {
|f|
filename = File.basename(f)
if CONFIG["circle"]["skip_features"].include? filename
next
end
files.push f
}

# Add loose features passed in as direct paths
elsif File.exist? param
Expand Down
1 change: 0 additions & 1 deletion profiles/dkan/.ahoy/.scripts/circle-behat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
puts "CIRCLE_NODE_TOTAL = #{CIRCLE_NODE_TOTAL}"
puts "CIRCLE_NODE_INDEX = #{CIRCLE_NODE_INDEX}"


error = 0
parsed = behat_parse_params(ARGV)
params = behat_join_params parsed[:params]
Expand Down
11 changes: 11 additions & 0 deletions profiles/dkan/.ahoy/.scripts/config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'yaml'

begin
CONFIG = YAML.load_file("config/config.yml")
rescue Exception => msg
puts "Loading of Configuration errored out with: #{msg}."
puts "Using default CONFIG instead."
CONFIG = {"circle" => {"skip_features" => []}}
end


2 changes: 1 addition & 1 deletion profiles/dkan/.ahoy/.scripts/dkan-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi

if [ ! -z "$files" ]; then
echo "Linting: $files"
test/bin/phpcs --standard=Drupal,DrupalPractice -n $files
test/bin/phpcs --standard=Drupal,DrupalPractice -n $files --ignore=test/dkanextension/*
else
echo "No Drupal file changes available for linting."
fi
12 changes: 12 additions & 0 deletions profiles/dkan/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
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
----------
- #1983 Apply services security update 3.20 for DRUPAL-SA-CONTRIB-2017-054
Expand Down
4 changes: 2 additions & 2 deletions profiles/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 profiles/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 profiles/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 profiles/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.
12 changes: 7 additions & 5 deletions profiles/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 @@ -58,6 +58,8 @@ projects:
version: '2.10'
defaultconfig:
version: 1.0-alpha11
devel:
version: '1.5'
diff:
version: '3.3'
double_field:
Expand Down Expand Up @@ -111,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 @@ -244,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 @@ -274,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 profiles/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 3c67a4f

Please sign in to comment.