From e7e4b5106359d2dbbb87ac1e10f4d439ce74ec89 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Mon, 30 Jul 2018 13:05:02 -0300 Subject: [PATCH 1/2] Fix catalog subjects issue --- inc/helpers/namespace.php | 5 +++-- partials/book.php | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/inc/helpers/namespace.php b/inc/helpers/namespace.php index f74abe0..a76065c 100644 --- a/inc/helpers/namespace.php +++ b/inc/helpers/namespace.php @@ -7,8 +7,9 @@ namespace Aldine\Helpers; -use Pressbooks\Book; use function \Pressbooks\Metadata\book_information_to_schema; +use function \Pressbooks\Metadata\is_bisac; +use Pressbooks\Book; /** * @param int $page @@ -142,7 +143,7 @@ function get_available_licenses( $catalog_data ) { function get_available_subjects( $catalog_data ) { $subjects = []; foreach ( $catalog_data['books'] as $book ) { - if ( ! empty( $book['subject'] ) ) { + if ( ! empty( $book['subject'] ) && ! is_bisac( $book['subject'] ) ) { $subjects[ substr( $book['subject'], 0, 1 ) ][] = substr( $book['subject'], 0, 2 ); } } diff --git a/partials/book.php b/partials/book.php index 1f6210a..d49d9a7 100644 --- a/partials/book.php +++ b/partials/book.php @@ -1,6 +1,9 @@ - + -
  • Date: Mon, 30 Jul 2018 15:25:49 -0300 Subject: [PATCH 2/2] Bump version --- README.md | 8 +++++++- package.json | 2 +- readme.txt | 7 ++++++- style.css | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f93e30a..920b1d3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ **Requires at least:** 4.9.6 **Tested up to:** 4.9.6 -**Stable tag:** 1.4.0 +**Stable tag:** 1.4.1 **License:** GNU General Public License v3 or later **License URI:** LICENSE @@ -42,6 +42,12 @@ TK. ## Changelog +# 1.4.1 + +**Patches** + +- Ensure that unsupported catalog subject codes aren't loaded: [#133](https://github.com/pressbooks/pressbooks-aldine/pull/133) + # 1.4.0 diff --git a/package.json b/package.json index 11f2c65..3205aec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pressbooks/pressbooks-aldine", - "version": "1.2.1", + "version": "1.4.1", "author": "Pressbooks (Book Oven Inc.) ", "homepage": "https://github.com/pressbooks/pressbooks-aldine/", "description": diff --git a/readme.txt b/readme.txt index 212ce65..14b50a1 100644 --- a/readme.txt +++ b/readme.txt @@ -16,7 +16,7 @@ Tags: publishing, catalog, pressbooks, default-theme Requires at least: 4.9.6 Tested up to: 4.9.6 -Stable tag: 1.4.0 +Stable tag: 1.4.1 License: GNU General Public License v3 or later License URI: LICENSE @@ -37,6 +37,11 @@ Aldine is the default theme for the home page of [Pressbooks](https://pressbooks TK. == Changelog == +=== 1.4.1 === + +**Patches** + +- Ensure that unsupported catalog subject codes aren't loaded: [#133](https://github.com/pressbooks/pressbooks-aldine/pull/133) === 1.4.0 === diff --git a/style.css b/style.css index e2f2402..8fd5ca6 100644 --- a/style.css +++ b/style.css @@ -2,7 +2,7 @@ Theme Name: Aldine Theme URI: https://github.com/pressbooks/pressbooks-aldine/ Description: Aldine is the default theme for the home page of Pressbooks networks. It is named for the Aldine Press, founded by Aldus Manutius in 1494, who is regarded by many as the world’s first publisher. -Version: 1.4.0 +Version: 1.4.1 Author: Pressbooks (Book Oven Inc.) Author URI: https://pressbooks.org Text Domain: pressbooks-aldine