From f5c1c860970e1744534addcb1103e7cfe98c6a4c Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Tue, 4 Apr 2023 18:09:50 -0400 Subject: [PATCH 1/3] Rename news category to Bibliotech Issues ** Why are these changes being introduced: * There is currently a confusing overlap between a content type and a category applied to that content type - both being named "Bibliotech" in some cases. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-300 ** How does this address that need: * This updates the name of the category applied to the Bibliotech post type to be "Bibliotech Issues", to prevent the confusion. ** Document any side effects to this change: * None --- .../plugins/mitlib-post-bibliotechs/src/class-bibliotech.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/plugins/mitlib-post-bibliotechs/src/class-bibliotech.php b/web/app/plugins/mitlib-post-bibliotechs/src/class-bibliotech.php index 2195f230..f02234a7 100644 --- a/web/app/plugins/mitlib-post-bibliotechs/src/class-bibliotech.php +++ b/web/app/plugins/mitlib-post-bibliotechs/src/class-bibliotech.php @@ -63,8 +63,8 @@ public static function define() { */ public static function taxonomies() { $labels = array( - 'name' => _x( 'Bibliotechs', 'Taxonomy General Name', 'text_domain' ), - 'singular_name' => _x( 'Bibliotech', 'Taxonomy Singular Name', 'text_domain' ), + 'name' => _x( 'Bibliotech Issues', 'Taxonomy General Name', 'text_domain' ), + 'singular_name' => _x( 'Bibliotech Issue', 'Taxonomy Singular Name', 'text_domain' ), 'menu_name' => __( 'Issues', 'text_domain' ), 'all_items' => __( 'All Issues', 'text_domain' ), 'parent_item' => __( 'Parent Issue', 'text_domain' ), From 7330cf0cc0569b8eace2ac9e61feaf0916376517 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Tue, 4 Apr 2023 18:46:13 -0400 Subject: [PATCH 2/3] Adds named image sizes to news theme ** Why are these changes being introduced: * The news theme makes reference to a few named image sizes which are not yet defined in the theme's functions.php file. This gap means that content editors are not constrained to the proper dimensions when they assign images to those fields which use the missing sizes. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-300 ** How does this address that need: * This adds the definitions for the image sizes to the news theme's functions.php. ** Document any side effects to this change: * None --- web/app/themes/mitlib-news/functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/app/themes/mitlib-news/functions.php b/web/app/themes/mitlib-news/functions.php index d3a0b614..56311023 100644 --- a/web/app/themes/mitlib-news/functions.php +++ b/web/app/themes/mitlib-news/functions.php @@ -68,6 +68,19 @@ function admin_styles() { } add_action( 'admin_head', 'Mitlib\News\admin_styles' ); +/** + * Add custom images for the news. + * + * @uses add_theme_support() To enable the theme's support for custom header + * images. + * @uses add_image_size() Registers a new image size for use by the theme. + */ +add_theme_support( 'post-thumbnails' ); +add_image_size( 'news-home', 111, 206, true ); // Hard Crop Mode. +add_image_size( 'news-listing', 323, 111, true ); // Hard Crop Mode. +add_image_size( 'news-feature', 657, 256, true ); // Hard Crop Mode. +add_image_size( 'news-single', 451, 651, true ); // Hard Crop Mode. + /** * Remove parent theme page templates. * From 9743f6d6b7897c15b4373ed4248ec7dcef05d3f8 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Wed, 5 Apr 2023 10:28:23 -0400 Subject: [PATCH 3/3] Fix configuration problems in some news fields ** Why are these changes being introduced: * There are two sets of custom fields which are not loading correctly. One is due to a name collision, as two JSON files have identical names. The other is because of invalid JSON. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-300 ** How does this address that need: * The two sets of field definisions which share a name are updated to use the "-1" and "-2" suffixes, like we use in other cases. * The invalid JSON is corrected in another field definition. ** Document any side effects to this change: * None (although I now want to identify a CLI tool that can be run by Composer in GitHub Actions to guard against this). --- .../mitlib-post/data/bibliotech/group_54dd062c59653-2.json | 2 +- .../mitlib-post/data/sitenews/group_54dd062c31627-1.json | 2 +- .../mitlib-post/data/spotlight/group_54dd062c31627-2.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json index e015b75a..be6d7c1a 100644 --- a/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json +++ b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json @@ -99,7 +99,7 @@ "operator": "==", "value": "administrator" } - ], + ] ], "menu_order": 7, "position": "normal", diff --git a/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json index 81605b45..64bbcbd3 100644 --- a/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json @@ -1,5 +1,5 @@ { - "key": "group_54dd062c31627", + "key": "group_54dd062c31627-1", "title": "Urgency flag (Post)", "fields": [ { diff --git a/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json index 7963e7f8..582cbdc3 100644 --- a/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json +++ b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json @@ -1,5 +1,5 @@ { - "key": "group_54dd062c31627", + "key": "group_54dd062c31627-2", "title": "Urgency flag (Spotlights)", "fields": [ {