Skip to content

Commit

Permalink
Update develop from master (#384)
Browse files Browse the repository at this point in the history
* fix: updating to latest atomic

* hotfix: downgrade captcha module

* hotfix: remove view/argument warnings

* fix: Adds checks to certain views basic variables to prevent errors in logs

* fix: don't return boolean, instead return actual operator value

* fix: Change to null coalescing operator

* fix: fix incorrect target ID for filtering

* fix: Account for backwards compatibility with older stored values prior to chosen

* fix: Check if terms arrays are arrays first

* fix: Additional checks to prevent errors in logs

* revert(chosen): remove composer-merge-plugin

Due to an issue with Pantheon and the now deprecated use of
composer-merge-plugin, we are removing references to it's use in order
to provide another fix for this.

References:
- https://www.drupal.org/node/3069730
- https://git.drupalcode.org/project/chosen/-/blob/4.0.x/README.txt

* fix(chosen): use installer-plugin to place chosenJS

In order for chosen to work in Drupal, it must reside in
./web/libraries/chosen.  This allows composer to utilize the
installer-paths to accomplish this.

Co-authoried-by: @vinmassaro

---------

Co-authored-by: Jim Vomero <[email protected]>
Co-authored-by: nJim <[email protected]>
Co-authored-by: Marc Berger <[email protected]>
Co-authored-by: David Blankenship <[email protected]>
Co-authored-by: David Blankenship <[email protected]>
  • Loading branch information
6 people authored Aug 17, 2023
1 parent 77e1615 commit 5c6755c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 30 deletions.
15 changes: 5 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"drupal/core-composer-scaffold": "^9.2",
"drupal/core-recommended": "^9.2",
"drush/drush": "^11 || ^12",
"oomphinc/composer-installers-extender": "^2.0",
"pantheon-systems/drupal-integrations": "^9",
"wikimedia/composer-merge-plugin": "^2.1",
"yalesites-org/yalesites_profile": "*"
},
"require-dev": {
Expand Down Expand Up @@ -58,6 +58,7 @@
"[project-root]/.gitattributes": false
}
},
"installer-types": ["npm-asset"],
"installer-paths": {
"web/core": [
"type:drupal-core"
Expand Down Expand Up @@ -88,20 +89,15 @@
],
"web/private/scripts/quicksilver/{$name}/": [
"type:quicksilver-script"
],
"web/libraries/chosen": [
"jjj/chosen"
]
},
"enable-patching": true,
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"allow-plugins": {
"JJJ/chosen": true
},
"merge-plugin": {
"include": [
"web/modules/contrib/chosen/composer.libraries.json"
]
}
},
"config": {
Expand All @@ -116,7 +112,6 @@
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"drupal/console-extend-plugin": true,
"wikimedia/composer-merge-plugin": true,
"oomphinc/composer-installers-extender": true
}
},
Expand Down
17 changes: 4 additions & 13 deletions web/profiles/custom/yalesites_profile/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"drupal/block_content_permissions": "^1.11",
"drupal/bugherd": "1.0",
"drupal/calendar_link": "^3.0",
"drupal/captcha": "^1.8",
"drupal/captcha": "1.10.0",
"drupal/cas": "^2.0",
"drupal/chosen": "^4.0",
"drupal/components": "^3.0",
Expand Down Expand Up @@ -82,30 +82,21 @@
"drupal/upgrade_status": "^3.18",
"drupal/webform": "^6.2@beta",
"drupal/wingsuit_companion": "^2.0@RC",
"oomphinc/composer-installers-extender": "^2.0",
"wikimedia/composer-merge-plugin": "^2.1",
"yalesites-org/atomic": "1.16.3",
"jjj/chosen": "^2.2",
"yalesites-org/atomic": "1.17.0",
"yalesites-org/yale_cas": "^1.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"oomphinc/composer-installers-extender": true,
"wikimedia/composer-merge-plugin": true
}
"sort-packages": true
},
"extra": {
"enable-patching": true,
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"installer-paths": {
"../../../../web/core": ["type:drupal-core"]
},
"patches": {
"drupal/layout_paragraphs": {
"save close tweaks": "https://git.drupalcode.org/project/layout_paragraphs/-/merge_requests/80.patch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ public function render() {

// Get node type to pass to template to determine width.
$entity = $this->routeMatch->getParameter('node');
if ($entity) {
$parentNode = $entity->getType();
}
$parentNode = isset($entity) ? $entity->getType() : NULL;

return [
'#theme' => 'views_basic_rows',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ public function getView($type, $params) {
*/

$filterType = implode('+', $paramsDecoded['filters']['types']);
$termsIncludeArray = [];
$termsExcludeArray = [];

// Get terms to include.
if (isset($paramsDecoded['filters']['terms_include'])) {
Expand All @@ -179,9 +181,10 @@ public function getView($type, $params) {
}

// Set operator: "+" is "OR" and "," is "AND".
$operator = $paramsDecoded['operator'] ?: '+';
$termsInclude = isset($termsIncludeArray) ? implode($operator, $termsIncludeArray) : 'all';
$termsExclude = isset($termsExcludeArray) ? implode($operator, $termsExcludeArray) : NULL;
$operator = $paramsDecoded['operator'] ?? '+';

$termsInclude = (count($termsIncludeArray) != 0) ? implode($operator, $termsIncludeArray) : 'all';
$termsExclude = (count($termsExcludeArray) != 0) ? implode($operator, $termsExcludeArray) : NULL;

if (
($type == 'count' && $paramsDecoded['display'] != 'limit') ||
Expand All @@ -192,6 +195,8 @@ public function getView($type, $params) {
$itemsLimit = $paramsDecoded['limit'];
}

$eventTimePeriod = $paramsDecoded['filters']['event_time_period'] ?? NULL;

$view->setArguments(
[
'type' => $filterType,
Expand All @@ -200,7 +205,7 @@ public function getView($type, $params) {
'sort' => $paramsDecoded['sort_by'],
'view' => $paramsDecoded['view_mode'],
'items' => $itemsLimit,
'event_time_period' => str_contains($filterType, 'event') ? $paramsDecoded['filters']['event_time_period'] : NULL,
'event_time_period' => str_contains($filterType, 'event') ? $eventTimePeriod : NULL,
]
);

Expand Down

0 comments on commit 5c6755c

Please sign in to comment.