@automattic/newspack-blocks 4.3.6 → 4.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [4.3.7](https://github.com/Automattic/newspack-blocks/compare/v4.3.6...v4.3.7) (2024-11-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * do not invalidate tax queries ([#1968](https://github.com/Automattic/newspack-blocks/issues/1968)) ([a0c1915](https://github.com/Automattic/newspack-blocks/commit/a0c191561e3bd6f16135590e66e5d695f2c3b3d3))
7
+
1
8
  ## [4.3.6](https://github.com/Automattic/newspack-blocks/compare/v4.3.5...v4.3.6) (2024-11-18)
2
9
 
3
10
 
@@ -1290,8 +1290,17 @@ class Newspack_Blocks {
1290
1290
  $exclude = $exclude['where'];
1291
1291
  $authors = " ( {$wpdb->posts}.post_author IN ( $csv ) $exclude ) ";
1292
1292
 
1293
- // Make sure the authors are set, the tax query is valid (doesn't contain 0 = 1).
1294
- if ( false === strpos( $tax_query['where'], ' 0 = 1' ) ) {
1293
+ /**
1294
+ * Make sure the authors are set, the tax query is valid (doesn't contain 0 = 1).
1295
+ *
1296
+ * Since we have two clauses (one searching on name, and one on slug), it's ok to have a "0 = 1" clause for
1297
+ * one of them, but not for both.
1298
+ *
1299
+ * The reason we might have invalid queries is because we do a broad search with many possibles term slugs and names.
1300
+ * There is not one consistent way terms are created, so the slug/name can have different values. We try to search for all of them, and
1301
+ * if none of the options we are searching for exist as a term, it will create an invalid query.
1302
+ */
1303
+ if ( substr_count( $tax_query['where'], ' 0 = 1' ) <= 1 ) {
1295
1304
  // Append to the current join parts. The JOIN statment only needs to exist in the clause once.
1296
1305
  if ( false === strpos( $clauses['join'], $tax_query['join'] ) ) {
1297
1306
  $clauses['join'] .= '/* newspack-blocks */ ' . $tax_query['join'] . ' /* /newspack-blocks */';
@@ -7,7 +7,7 @@
7
7
  * Author URI: https://newspack.com/
8
8
  * Text Domain: newspack-blocks
9
9
  * Domain Path: /languages
10
- * Version: 4.3.6
10
+ * Version: 4.3.7
11
11
  *
12
12
  * @package Newspack_Blocks
13
13
  */
@@ -15,7 +15,7 @@
15
15
  define( 'NEWSPACK_BLOCKS__PLUGIN_FILE', __FILE__ );
16
16
  define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
17
17
  define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( NEWSPACK_BLOCKS__PLUGIN_FILE ) );
18
- define( 'NEWSPACK_BLOCKS__VERSION', '4.3.6' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '4.3.7' );
19
19
 
20
20
  require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks.php';
21
21
  require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks-api.php';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/newspack-blocks",
3
- "version": "4.3.6",
3
+ "version": "4.3.7",
4
4
  "author": "Automattic",
5
5
  "devDependencies": {
6
6
  "@rushstack/eslint-patch": "^1.10.4",
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
22
22
 
23
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
24
 
25
- return ComposerAutoloaderInit709658e8801f92df48c90150e6ddf243::getLoader();
25
+ return ComposerAutoloaderInitc36d9627c62d88af4f121f11954d8390::getLoader();
@@ -2,7 +2,7 @@
2
2
 
3
3
  // autoload_real.php @generated by Composer
4
4
 
5
- class ComposerAutoloaderInit709658e8801f92df48c90150e6ddf243
5
+ class ComposerAutoloaderInitc36d9627c62d88af4f121f11954d8390
6
6
  {
7
7
  private static $loader;
8
8
 
@@ -22,12 +22,12 @@ class ComposerAutoloaderInit709658e8801f92df48c90150e6ddf243
22
22
  return self::$loader;
23
23
  }
24
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit709658e8801f92df48c90150e6ddf243', 'loadClassLoader'), true, true);
25
+ spl_autoload_register(array('ComposerAutoloaderInitc36d9627c62d88af4f121f11954d8390', 'loadClassLoader'), true, true);
26
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
- spl_autoload_unregister(array('ComposerAutoloaderInit709658e8801f92df48c90150e6ddf243', 'loadClassLoader'));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitc36d9627c62d88af4f121f11954d8390', 'loadClassLoader'));
28
28
 
29
29
  require __DIR__ . '/autoload_static.php';
30
- call_user_func(\Composer\Autoload\ComposerStaticInit709658e8801f92df48c90150e6ddf243::getInitializer($loader));
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitc36d9627c62d88af4f121f11954d8390::getInitializer($loader));
31
31
 
32
32
  $loader->register(true);
33
33
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  namespace Composer\Autoload;
6
6
 
7
- class ComposerStaticInit709658e8801f92df48c90150e6ddf243
7
+ class ComposerStaticInitc36d9627c62d88af4f121f11954d8390
8
8
  {
9
9
  public static $classMap = array (
10
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -13,7 +13,7 @@ class ComposerStaticInit709658e8801f92df48c90150e6ddf243
13
13
  public static function getInitializer(ClassLoader $loader)
14
14
  {
15
15
  return \Closure::bind(function () use ($loader) {
16
- $loader->classMap = ComposerStaticInit709658e8801f92df48c90150e6ddf243::$classMap;
16
+ $loader->classMap = ComposerStaticInitc36d9627c62d88af4f121f11954d8390::$classMap;
17
17
 
18
18
  }, null, ClassLoader::class);
19
19
  }
@@ -3,7 +3,7 @@
3
3
  'name' => 'automattic/newspack-blocks',
4
4
  'pretty_version' => 'dev-trunk',
5
5
  'version' => 'dev-trunk',
6
- 'reference' => '2c8c1e6030e6a2b0777ee2756bb2d7196f74fca9',
6
+ 'reference' => 'a0c191561e3bd6f16135590e66e5d695f2c3b3d3',
7
7
  'type' => 'wordpress-plugin',
8
8
  'install_path' => __DIR__ . '/../../',
9
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
13
  'automattic/newspack-blocks' => array(
14
14
  'pretty_version' => 'dev-trunk',
15
15
  'version' => 'dev-trunk',
16
- 'reference' => '2c8c1e6030e6a2b0777ee2756bb2d7196f74fca9',
16
+ 'reference' => 'a0c191561e3bd6f16135590e66e5d695f2c3b3d3',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),