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

Commit

Permalink
Remake Dkan data_starter 1.12.10.x plus... (#146)
Browse files Browse the repository at this point in the history
* Update php version.

PHP version 5.5.11 is no longer included by default in newer Circle Images.

REF CIVIC-4224

* Update data_config.module

* Update php version and fix perl missing lib.

REF CIVIC-4224

* run apt-get update before installing.

* Checking to see if it's the update that is hurting us.

REF CIVIC-4298

* Move updates to pre build step.

REF CIVIC-4298

* Remake dkan and ahoy tools.
  • Loading branch information
acouch authored and dkinzer committed Oct 6, 2016
1 parent 2c52cb9 commit 173d2ed
Show file tree
Hide file tree
Showing 26 changed files with 187 additions and 88 deletions.
4 changes: 3 additions & 1 deletion assets/modules/data_config/data_config.module
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ function data_config_enabled_modules() {
* Add alert when modules are disabled that should not be.
*/
function data_config_modules_disabled($modules) {
$feature_master_list = array();
$module_data = system_rebuild_module_data();
$temp_disabled_modules = variable_get('features_master_temp_disabled_modules', array());
$modules_warn = array_diff($modules, $temp_disabled_modules);
Expand All @@ -244,7 +245,8 @@ function data_config_modules_disabled($modules) {
}
$dependencies[$module] = array_intersect($dependencies[$module], $modules_warn);
}
$feature_master_list = custom_config_features_master_defaults();
module_load_include('inc','custom_config','features.features_master');
$feature_master_list = function_exists('custom_config_features_master_defaults') ? custom_config_features_master_defaults(): array();
$feature_master_list = array_keys($feature_master_list['modules']);
$dpt_output = array(
array('Modules being disabled', 'In feature master list?', 'Cross Dependencies with modules being disabled'),
Expand Down
9 changes: 5 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ machine:

# Version of ruby to use
php:
version: '5.5.11'
version: '5.6.22'

# Override /etc/hosts
#hosts:
Expand Down Expand Up @@ -41,7 +41,10 @@ dependencies:
#- "backups"
#- "dkan/test/sites/default"
pre:
- echo "memory_limit = 256M" > ~/.phpenv/versions/5.5.11/etc/conf.d/memory.ini
- echo "memory_limit = 256M" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/memory.ini
- sudo apt-get update -y && sudo apt-get install -y x11vnc clamav clamav-freshclam
- yes | sudo perl -MCPAN -e "install Digest::HMAC_SHA1;"

override:
- printenv
- mkdir $CIRCLE_ARTIFACTS/junit
Expand All @@ -65,7 +68,6 @@ dependencies:
- java -jar selenium-server-standalone-2.49.1.jar -p 4444 :
background: true
post:
- sudo apt-get install -y x11vnc clamav clamav-freshclam
- x11vnc -forever -nopw:
background: true

Expand All @@ -75,7 +77,6 @@ test:
- ruby dkan/.ahoy/.scripts/circle-behat.rb docroot/profiles/dkan/test/features --tags='~@customizable&&~@fixme&&~@testBug':
parallel: true
- ahoy site test

post:
- echo $CIRCLE_ARTIFACTS; cp -av dkan/test/assets $CIRCLE_ARTIFACTS:
parallel: true
10 changes: 10 additions & 0 deletions dkan/.ahoy/.scripts/active_theme_path.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

$theme = variable_get('theme_default');
echo implode(
'/',
array(
DRUPAL_ROOT,
drupal_get_path('theme', $theme)
)
);
4 changes: 2 additions & 2 deletions dkan/circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ machine:

# Version of ruby to use
php:
version: '5.5.11'
version: '5.6.22'

# Override /etc/hosts
#hosts:
Expand Down Expand Up @@ -41,7 +41,7 @@ dependencies:
#- "backups"
#- "dkan/test/sites/default"
pre:
- echo "memory_limit = 256M" > ~/.phpenv/versions/5.5.11/etc/conf.d/memory.ini
- echo "memory_limit = 256M" > $PHPENV_ROOT/versions/$(phpenv global)/etc/conf.d/memory.ini
override:
- printenv
- mkdir $CIRCLE_ARTIFACTS/junit
Expand Down
9 changes: 9 additions & 0 deletions dkan/dkan.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ function dkan_update_7001() {
module_load_include("profile", "dkan");
dkan_bueditor_markdown_install();
}

/**
* Update the default jquery library to 1.10.
*/
function dkan_update_7002() {
if(version_compare(variable_get('jquery_update_jquery_version'), '1.10', '<')) {
variable_set('jquery_update_jquery_version', '1.10');
}
}
18 changes: 9 additions & 9 deletions dkan/dkan.profile
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function dkan_misc_variables_set(&$context) {
variable_set('page_manager_node_edit_disabled', FALSE);
variable_set('page_manager_user_view_disabled', FALSE);
// variable_set('page_manager_override_anyway', 'TRUE');
variable_set('jquery_update_jquery_version', '1.7');
variable_set('jquery_update_jquery_version', '1.10');
// Disable selected views enabled by contributed modules.
$views_disable = array(
'og_extras_nodes' => TRUE,
Expand Down Expand Up @@ -442,30 +442,30 @@ function dkan_bueditor_markdown_install() {
foreach ($roles as $rid => $role) {
switch($role) {
case 'anonymous user':
$bueditor_roles[$rid] = [
$bueditor_roles[$rid] = array(
'weight' => 12,
'editor' => _dkan_bueditor_by_name('Commenter'),
'alt' => 0,
];
);
break;

case 'administrator':
case 'content creator':
case 'editor':
case 'site manager':
$bueditor_roles[$rid] = [
$bueditor_roles[$rid] = array(
'weight' => 0,
'editor' => _dkan_bueditor_by_name('Markdowneditor'),
'alt' => 0,
];
);
break;

default:
$bueditor_roles[$rid] = [
$bueditor_roles[$rid] = array(
'weight' => 11,
'editor' => 0,
'alt' => 0,
];
);
}
}

Expand All @@ -478,10 +478,10 @@ function dkan_bueditor_markdown_install() {
->execute()
->fetchField();

$data = [
$data = array(
'html' => ['default' => $eid, 'alternative' => 0],
'plain_text' => ['plain_text' => 0, 'alternative' => 0]
];
);

db_insert('bueditor_plus_profiles')
->fields(array(
Expand Down
4 changes: 2 additions & 2 deletions dkan/modules/contrib/entity/entity.info
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ files[] = views/handlers/entity_views_handler_field_uri.inc
files[] = views/handlers/entity_views_handler_relationship_by_bundle.inc
files[] = views/handlers/entity_views_handler_relationship.inc
files[] = views/plugins/entity_views_plugin_row_entity_view.inc
; Information added by drush on 2016-03-17
; Information added by drush on 2016-09-28
version = "7.x-1.7"
project = "entity"
datestamp = "1458234169"
datestamp = "1475068387"
4 changes: 2 additions & 2 deletions dkan/modules/contrib/entity/entity_token.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ files[] = entity_token.tokens.inc
files[] = entity_token.module
dependencies[] = entity

; Information added by drush on 2016-03-17
; Information added by drush on 2016-09-28
version = "7.x-1.7"
project = "entity"
datestamp = "1458234169"
datestamp = "1475068387"
4 changes: 2 additions & 2 deletions dkan/modules/contrib/entity/tests/entity_feature.info
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ files[] = entity_feature.module
dependencies[] = entity_test
hidden = TRUE

; Information added by drush on 2016-03-17
; Information added by drush on 2016-09-28
version = "7.x-1.7"
project = "entity"
datestamp = "1458234169"
datestamp = "1475068387"
4 changes: 2 additions & 2 deletions dkan/modules/contrib/entity/tests/entity_test.info
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ files[] = entity_test.install
dependencies[] = entity
hidden = TRUE

; Information added by drush on 2016-03-17
; Information added by drush on 2016-09-28
version = "7.x-1.7"
project = "entity"
datestamp = "1458234169"
datestamp = "1475068387"
4 changes: 2 additions & 2 deletions dkan/modules/contrib/entity/tests/entity_test_i18n.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies[] = i18n_string
package = Multilingual - Internationalization
core = 7.x
hidden = TRUE
; Information added by drush on 2016-03-17
; Information added by drush on 2016-09-28
version = "7.x-1.7"
project = "entity"
datestamp = "1458234169"
datestamp = "1475068387"
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class entity_views_handler_area_entity extends views_handler_area {
$form['entity_id'] = array(
'#type' => 'textfield',
'#title' => t('Entity id'),
'#description' => t('Choose the entity you want to display in the area.'),
'#description' => t('Choose the entity you want to display in the area. To render an entity given by a contextual filter use "%1" for the first argument, "%2" for the second, etc.'),
'#default_value' => $this->options['entity_id'],
);

Expand Down Expand Up @@ -105,6 +105,9 @@ class entity_views_handler_area_entity extends views_handler_area {
* Render an entity using the view mode.
*/
public function render_entity($entity_type, $entity_id, $view_mode) {
$tokens = $this->get_render_tokens();
// Replace argument tokens in entity id.
$entity_id = strtr($entity_id, $tokens);
if (!empty($entity_type) && !empty($entity_id) && !empty($view_mode)) {
$entity = entity_load_single($entity_type, $entity_id);
if (!empty($this->options['bypass_access']) || entity_access('view', $entity_type, $entity)) {
Expand All @@ -117,4 +120,31 @@ class entity_views_handler_area_entity extends views_handler_area {
return '';
}
}

/**
* Get the 'render' tokens to use for advanced rendering.
*
* This runs through all of the fields and arguments that
* are available and gets their values. This will then be
* used in one giant str_replace().
*/
function get_render_tokens() {
$tokens = array();
if (!empty($this->view->build_info['substitutions'])) {
$tokens = $this->view->build_info['substitutions'];
}
$count = 0;
foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
$token = '%' . ++$count;
if (!isset($tokens[$token])) {
$tokens[$token] = '';
}
// Use strip tags as there should never be HTML in the path.
// However, we need to preserve special characters like " that
// were removed by check_plain().
$tokens['%' . $count] = $handler->argument;
}

return $tokens;
}
}
4 changes: 4 additions & 0 deletions dkan/modules/contrib/entity_path/PATCHES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The following patches have been applied to this project:
- https://www.drupal.org/files/issues/entity-path-mysql-5-7_1.diff

This file was automatically generated by Drush Make (http://drupal.org/project/drush).
18 changes: 16 additions & 2 deletions dkan/modules/contrib/entity_path/entity_path.install
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function entity_path_schema() {
'cid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => FALSE,
'not null' => TRUE,
'description' => 'The primary identifier for a entity_path configuration set.',
),
'instance' => array(
Expand Down Expand Up @@ -107,4 +107,18 @@ function entity_path_update_7101() {
}

return t('You now can specify query and fragment in your entity path configurations.');
}
}

/**
* Updates cid for MySQL 5.7 compatibility.
*/
function entity_path_update_7102() {
db_drop_primary_key('cid');
$cid = array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The primary identifier for a entity_path configuration set.',
);
db_change_field('entity_path_config', 'cid', 'cid', $cid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ function _facet_is_content_type($value) {
* @return boolean
*/
function _facet_is_term($name, $tid) {
$result = db_select('taxonomy_term_data', 'terms')
$query = db_select('taxonomy_term_data', 'terms')
->fields('terms', array('name'))
->condition('name', $name, 'LIKE')
->condition('tid', $tid)
->execute();
return $result->rowCount() > 0;
$result = $query->fetchObject();
if ($query->rowCount() > 0) {
$n1 = pathauto_cleanstring($result->name);
$n2 = pathauto_cleanstring(urldecode($name));
return $n1 == $n2;
}
return FALSE;
}

/**
Expand Down Expand Up @@ -99,7 +104,7 @@ function _alter_search_callback($argument) {
if (!is_numeric($last)) {
return drupal_not_found();
}
$term = array(implode('_', $term), $last);
$term = array(implode('-', $term), $last);
// Save the extra query if we can.
if (count($term) == 1) {
return drupal_not_found();
Expand Down
2 changes: 1 addition & 1 deletion dkan/modules/dkan/dkan_topics/dkan_topics.entity_path.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function dkan_topics_entity_path_config_default() {
$entity_path_config->query_pattern = '';
$entity_path_config->fragment_pattern = '';
$entity_path_config->config = array(
'pathauto_cleanstring' => 0,
'pathauto_cleanstring' => 1,
'space_separator' => 1,
'space_separator_char' => '-',
'path_case' => 'lowercase',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
function dkan_topics_field_default_field_bases() {
$field_bases = array();

// Exported field_base: 'field_icon_type'
// Exported field_base: 'field_icon_type'.
$field_bases['field_icon_type'] = array(
'active' => 1,
'cardinality' => 1,
Expand All @@ -35,7 +35,7 @@ function dkan_topics_field_default_field_bases() {
'type' => 'list_text',
);

// Exported field_base: 'field_topic'
// Exported field_base: 'field_topic'.
$field_bases['field_topic'] = array(
'active' => 1,
'cardinality' => -1,
Expand All @@ -61,7 +61,7 @@ function dkan_topics_field_default_field_bases() {
'type' => 'taxonomy_term_reference',
);

// Exported field_base: 'field_topic_icon'
// Exported field_base: 'field_topic_icon'.
$field_bases['field_topic_icon'] = array(
'active' => 1,
'cardinality' => 1,
Expand All @@ -80,7 +80,7 @@ function dkan_topics_field_default_field_bases() {
'type' => 'font_icon_select_icon',
);

// Exported field_base: 'field_topic_icon_color'
// Exported field_base: 'field_topic_icon_color'.
$field_bases['field_topic_icon_color'] = array(
'active' => 1,
'cardinality' => 1,
Expand Down
Loading

0 comments on commit 173d2ed

Please sign in to comment.