Skip to content

Commit

Permalink
10.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Nov 27, 2023
2 parents da08c36 + 52ef330 commit 50f8aba
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 46 deletions.
71 changes: 36 additions & 35 deletions composer.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ paragraph_behaviors:
js/paragraphs.behaviors.js: { }
css:
base:
css/paragraphs.behaviors.css: { }
css/paragraphs.behaviors.css: { }
dependencies:
- core/jquery
- core/once
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Stops page from changing when user is posting.
*/

(function ($, Drupal) {
(function ($, Drupal, once) {
'use strict';

Drupal.behaviors.humsciParagraphBehaviors = {
attach: function (context, settings) {
$('ul.paragraphs-tabs', context).remove();
$('.paragraphs-subform', context).once('hs-heaviors').each(function () {
$(once('hs-behaviors', '.paragraphs-subform', context)).each(function () {
const $subform = $(this);
const $behaviors = $(this).siblings('.paragraphs-behavior')
const $tabs = $('<ul class="hs-paragraphs-tabs tabs">');
Expand All @@ -32,4 +32,4 @@
});
}
};
})(jQuery, Drupal);
})(jQuery, Drupal, once);
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Drupal\hs_field_helpers\Plugin\Field\FieldFormatter;

use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\EnforcedResponseException;
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\viewfield\Plugin\Field\FieldFormatter\ViewfieldFormatterDefault;
use Drupal\views\ViewExecutable;
Expand All @@ -24,9 +25,15 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = parent::viewElements($items, $langcode);
}
catch (\Throwable $e) {
if ($e instanceof EnforcedResponseException) {
throw $e;
}

$this->getLogger('hs_field_helpers')
->error('Error during rendering: ' . $e->getMessage());
return [];
return [
'#markup' => $this->t('An error occurred when generating your content.'),
];
}

// Add and customize the view title.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ views_reset:
js/hs_views_helper.views_reset.js: {}
dependencies:
- core/drupal.ajax
- core/once
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function ($, Drupal) {
(function ($, Drupal, once) {
'use strict';

Drupal.behaviors.hsFieldHelpersViewsReset = {
Expand All @@ -7,7 +7,8 @@
return;
}
$.each(Drupal.views.instances, function (key, ajaxView) {
ajaxView['$exposed_form'].find('input[data-drupal-selector=edit-reset]').once('views-reset').click(function (e) {

$(once('views-reset', ajaxView['$exposed_form'].find('input[data-drupal-selector=edit-reset]'))).click(function (e) {
e.preventDefault();

// Reset the form and trigger chosen select fields.
Expand All @@ -27,4 +28,4 @@
});
}
};
})(jQuery, Drupal);
})(jQuery, Drupal, once);
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'DO NOT INSTALL. This is for profile installation task only.'
core_version_requirement: '^9.4 || ^10'
hidden: true
type: module
version: 10.0.3
version: 10.0.4
default_content:
shortcut:
- 0c69448d-c6fa-4fb8-9b2e-f93f3a955baf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dependencies:
- 'hook_event_dispatcher:views_event_dispatcher'
- 'rabbit_hole:rabbit_hole'
- 'drupal:path_alias'
version: 10.0.3
version: 10.0.4
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Stanford HumSci'
type: profile
description: 'Installation profile for HumSci Drupal'
version: 10.0.3
version: 10.0.4
core_version_requirement: '^9.4 || ^10'
themes:
- material_admin
Expand Down

0 comments on commit 50f8aba

Please sign in to comment.