Skip to content
Snippets Groups Projects
Commit 010c9cb3 authored by Michael Lee's avatar Michael Lee
Browse files

Upgrading drupal/decorative_image_widget (1.0.0 => 1.0.1)

parent c3c2c489
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@
"drupal/core-recommended": "9.5.11",
"drupal/crop": "2.3",
"drupal/ctools": "3.14",
"drupal/decorative_image_widget": "1.0",
"drupal/decorative_image_widget": "^1.0",
"drupal/dropzonejs": "2.8",
"drupal/editor_advanced_link": "2.2.4",
"drupal/embed": "1.6",
......@@ -278,9 +278,6 @@
"drupal/addtocalendar": {
"UTC Time Adjustment": "patches/utc-time-adjustment.patch"
},
"drupal/decorative_image_widget": {
"3383305": "https://www.drupal.org/files/issues/2023-08-25/3383305-2.patch"
},
"drupal/entity_embed": {
"3077225": "https://www.drupal.org/files/issues/2019-12-11/3077225-10.reduce-invalid-config-logs.patch"
},
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "104ad135cd2c808452366057a8c99003",
"content-hash": "fa23752cf2e7b6427ecb75714646b0b3",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -2749,17 +2749,17 @@
},
{
"name": "drupal/decorative_image_widget",
"version": "1.0.0",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/decorative_image_widget.git",
"reference": "1.0.0"
"reference": "1.0.1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/decorative_image_widget-1.0.0.zip",
"reference": "1.0.0",
"shasum": "da118d519d20ba2d3ed4ffeb037259a267cbc0f7"
"url": "https://ftp.drupal.org/files/projects/decorative_image_widget-1.0.1.zip",
"reference": "1.0.1",
"shasum": "1bcd473add81bc96296a98796880cb2f6a0ccb47"
},
"require": {
"drupal/core": "^9.2 || ^10"
......@@ -2767,8 +2767,8 @@
"type": "drupal-module",
"extra": {
"drupal": {
"version": "1.0.0",
"datestamp": "1691175827",
"version": "1.0.1",
"datestamp": "1696726436",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -2867,18 +2867,18 @@
},
{
"name": "drupal/decorative_image_widget",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"version": "1.0.1",
"version_normalized": "1.0.1.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/decorative_image_widget.git",
"reference": "1.0.0"
"reference": "1.0.1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/decorative_image_widget-1.0.0.zip",
"reference": "1.0.0",
"shasum": "da118d519d20ba2d3ed4ffeb037259a267cbc0f7"
"url": "https://ftp.drupal.org/files/projects/decorative_image_widget-1.0.1.zip",
"reference": "1.0.1",
"shasum": "1bcd473add81bc96296a98796880cb2f6a0ccb47"
},
"require": {
"drupal/core": "^9.2 || ^10"
......@@ -2886,15 +2886,12 @@
"type": "drupal-module",
"extra": {
"drupal": {
"version": "1.0.0",
"datestamp": "1691175827",
"version": "1.0.1",
"datestamp": "1696726436",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"patches_applied": {
"3383305": "https://www.drupal.org/files/issues/2023-08-25/3383305-2.patch"
}
},
"installation-source": "dist",
......
......@@ -3,7 +3,7 @@
'name' => 'osu-asc-webservices/d8-upstream',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'fe8daab509c90a8c984673aa0c6d6770fdfd1cab',
'reference' => 'c3c2c4898587953ab94a0ac39e0658dbaecc8751',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......@@ -563,9 +563,9 @@
'dev_requirement' => false,
),
'drupal/decorative_image_widget' => array(
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'reference' => '1.0.0',
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'reference' => '1.0.1',
'type' => 'drupal-module',
'install_path' => __DIR__ . '/../../web/modules/decorative_image_widget',
'aliases' => array(),
......@@ -1450,7 +1450,7 @@
'osu-asc-webservices/d8-upstream' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'fe8daab509c90a8c984673aa0c6d6770fdfd1cab',
'reference' => 'c3c2c4898587953ab94a0ac39e0658dbaecc8751',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
......
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
3383305
Source: https://www.drupal.org/files/issues/2023-08-25/3383305-2.patch
......@@ -6,7 +6,7 @@ package: Media
dependencies:
- drupal:image
# Information added by Drupal.org packaging script on 2023-08-04
version: '1.0.0'
# Information added by Drupal.org packaging script on 2023-10-08
version: '1.0.1'
project: 'decorative_image_widget'
datestamp: 1691175829
datestamp: 1696726438
......@@ -36,15 +36,17 @@ function decorative_image_widget_field_widget_settings_summary_alter(array &$sum
* Implements hook_field_widget_form_alter().
*/
function decorative_image_widget_field_widget_form_alter(array &$element, FormStateInterface $form_state, array $context) {
// Note this hook is only executed for Drupal 9.
if ($context['widget'] instanceof ImageWidget) {
DecorativeImageWidgetHelper::alter($element, $context['widget']);
}
}
/**
* Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
* Implements hook_field_widget_single_element_form_alter().
*/
function decorative_image_widget_field_widget_single_element_image_image_form_alter(array &$element, FormStateInterface $form_state, array $context) {
function decorative_image_widget_field_widget_single_element_form_alter(array &$element, FormStateInterface $form_state, array $context) {
// Note this hook is only executed for Drupal 10+.
if ($context['widget'] instanceof ImageWidget) {
DecorativeImageWidgetHelper::alter($element, $context['widget']);
}
......
......@@ -20,14 +20,30 @@
function enableOrDisableAltTextField($altTextField, enable) {
if (!enable) {
// Edit input field attributes.
$altTextField
.prop('disabled', true)
.parent().addClass('form-disabled');
.prop("disabled", true)
.prop("required", false)
.removeClass("required");
// Edit parent element classes.
$altTextField.parent().addClass("form-disabled");
// Edit label element.
$altTextField.parent().find("label").removeClass("form-required");
}
else {
// Edit input field attributes.
$altTextField
.prop('disabled', false)
.parent().removeClass('form-disabled');
.prop("disabled", false)
.prop("required", true)
.addClass("required");
// Edit parent element classes.
$altTextField.parent().removeClass("form-disabled");
// Edit label element.
$altTextField.parent().find("label").addClass("form-required");
}
}
},
......
......@@ -170,15 +170,20 @@ public static function validateAltText(array $element, FormStateInterface $formS
return;
}
// If the alt text is empty, then throw a validation error if the
// decorative checkbox was left unchecked.
if (empty($formState->getValue($element['#parents']))) {
$parents = $element['#parents'];
array_pop($parents);
$parents[] = 'decorative';
if (empty($formState->getValue($parents))) {
$formState->setErrorByName(implode('][', $element['#parents']), t('You must provide alternative text or indicate the image is decorative.'));
}
$parents = $element['#parents'];
array_pop($parents);
// Back out if no image was submitted.
$fid_form_element = array_merge($parents, ['fids']);
if (empty($formState->getValue($fid_form_element))) {
return;
}
$missing_alt_text = empty($formState->getValue($element['#parents']));
$decorative_form_element = array_merge($parents, ['decorative']);
$decorative_checked = (bool) $formState->getValue($decorative_form_element);
if ($missing_alt_text && !$decorative_checked) {
$formState->setErrorByName(implode('][', $element['#parents']), t('You must provide alternative text or indicate the image is decorative.'));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment