Plugin Directory

Changeset 3389253


Ignore:
Timestamp:
11/04/2025 12:02:19 AM (5 months ago)
Author:
1fixdotio
Message:

Release 0.9.1 to fix a SQL bug

Location:
media-search-enhanced
Files:
8 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • media-search-enhanced/tags/0.9.1/README.txt

    r3037074 r3389253  
    66Requires at least: 3.5
    77Tested up to: 6.4.3
    8 Stable tag: 0.9.0
     8Stable tag: 0.9.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6666== Changelog ==
    6767
     68= 0.9.1 =
     69* Fix: Prevent "Not unique table/alias: wp_postmeta" SQL error by aliasing the postmeta JOIN. Props [@mikemeinz](https://wordpress.org/support/users/mikemeinz/). See https://wordpress.org/support/topic/sql-syntax-error-26/
     70
    6871= 0.9.0 =
    6972* Added the languages pt_BR and es_ES. Thanks to [@larodiel](https://github.com/1fixdotio/media-search-enhanced/pull/4).
  • media-search-enhanced/tags/0.9.1/media-search-enhanced.php

    r3037074 r3389253  
    1515 * Plugin URI:        https://1fix.io/media-search-enhanced
    1616 * Description:       Search through all fields in Media Library.
    17  * Version:           0.9.0
     17 * Version:           0.9.1
    1818 * Author:            1fixdotio
    1919 * Author URI:        https://1fix.io
  • media-search-enhanced/tags/0.9.1/public/class-media-search-enhanced.php

    r3037074 r3389253  
    2929     * @var     string
    3030     */
    31     const VERSION = '0.8.0';
     31    const VERSION = '0.9.1';
    3232
    3333    /**
     
    190190            $like = '%' . $wpdb->esc_like( $vars['s'] ) . '%';
    191191            $pieces['where'] .= $wpdb->prepare( " AND ( ($wpdb->posts.ID LIKE %s) OR ($wpdb->posts.post_title LIKE %s) OR ($wpdb->posts.guid LIKE %s) OR ($wpdb->posts.post_content LIKE %s) OR ($wpdb->posts.post_excerpt LIKE %s)", $like, $like, $like, $like, $like );
    192             $pieces['where'] .= $wpdb->prepare( " OR ($wpdb->postmeta.meta_key = '_wp_attachment_image_alt' AND $wpdb->postmeta.meta_value LIKE %s)", $like );
    193             $pieces['where'] .= $wpdb->prepare( " OR ($wpdb->postmeta.meta_key = '_wp_attached_file' AND $wpdb->postmeta.meta_value LIKE %s)", $like );
    194 
    195             // Get taxes for attachements
     192            $pieces['where'] .= $wpdb->prepare( " OR (mse_pm.meta_key = '_wp_attachment_image_alt' AND mse_pm.meta_value LIKE %s)", $like );
     193            $pieces['where'] .= $wpdb->prepare( " OR (mse_pm.meta_key = '_wp_attached_file' AND mse_pm.meta_value LIKE %s)", $like );
     194
     195            // Get taxes for attachments
    196196            $taxes = get_object_taxonomies( 'attachment' );
    197197            if ( ! empty( $taxes ) ) {
     
    201201            $pieces['where'] .= " )";
    202202
    203             $pieces['join'] .= " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id";
    204 
    205             // Get taxes for attachements
     203            $pieces['join'] .= " LEFT JOIN $wpdb->postmeta AS mse_pm ON $wpdb->posts.ID = mse_pm.post_id";
     204
     205            // Get taxes for attachments
    206206            $taxes = get_object_taxonomies( 'attachment' );
    207207            if ( ! empty( $taxes ) ) {
  • media-search-enhanced/trunk/README.txt

    r3037074 r3389253  
    66Requires at least: 3.5
    77Tested up to: 6.4.3
    8 Stable tag: 0.9.0
     8Stable tag: 0.9.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6666== Changelog ==
    6767
     68= 0.9.1 =
     69* Fix: Prevent "Not unique table/alias: wp_postmeta" SQL error by aliasing the postmeta JOIN. Props [@mikemeinz](https://wordpress.org/support/users/mikemeinz/). See https://wordpress.org/support/topic/sql-syntax-error-26/
     70
    6871= 0.9.0 =
    6972* Added the languages pt_BR and es_ES. Thanks to [@larodiel](https://github.com/1fixdotio/media-search-enhanced/pull/4).
  • media-search-enhanced/trunk/media-search-enhanced.php

    r3037074 r3389253  
    1515 * Plugin URI:        https://1fix.io/media-search-enhanced
    1616 * Description:       Search through all fields in Media Library.
    17  * Version:           0.9.0
     17 * Version:           0.9.1
    1818 * Author:            1fixdotio
    1919 * Author URI:        https://1fix.io
  • media-search-enhanced/trunk/public/class-media-search-enhanced.php

    r3037074 r3389253  
    2929     * @var     string
    3030     */
    31     const VERSION = '0.8.0';
     31    const VERSION = '0.9.1';
    3232
    3333    /**
     
    190190            $like = '%' . $wpdb->esc_like( $vars['s'] ) . '%';
    191191            $pieces['where'] .= $wpdb->prepare( " AND ( ($wpdb->posts.ID LIKE %s) OR ($wpdb->posts.post_title LIKE %s) OR ($wpdb->posts.guid LIKE %s) OR ($wpdb->posts.post_content LIKE %s) OR ($wpdb->posts.post_excerpt LIKE %s)", $like, $like, $like, $like, $like );
    192             $pieces['where'] .= $wpdb->prepare( " OR ($wpdb->postmeta.meta_key = '_wp_attachment_image_alt' AND $wpdb->postmeta.meta_value LIKE %s)", $like );
    193             $pieces['where'] .= $wpdb->prepare( " OR ($wpdb->postmeta.meta_key = '_wp_attached_file' AND $wpdb->postmeta.meta_value LIKE %s)", $like );
    194 
    195             // Get taxes for attachements
     192            $pieces['where'] .= $wpdb->prepare( " OR (mse_pm.meta_key = '_wp_attachment_image_alt' AND mse_pm.meta_value LIKE %s)", $like );
     193            $pieces['where'] .= $wpdb->prepare( " OR (mse_pm.meta_key = '_wp_attached_file' AND mse_pm.meta_value LIKE %s)", $like );
     194
     195            // Get taxes for attachments
    196196            $taxes = get_object_taxonomies( 'attachment' );
    197197            if ( ! empty( $taxes ) ) {
     
    201201            $pieces['where'] .= " )";
    202202
    203             $pieces['join'] .= " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id";
    204 
    205             // Get taxes for attachements
     203            $pieces['join'] .= " LEFT JOIN $wpdb->postmeta AS mse_pm ON $wpdb->posts.ID = mse_pm.post_id";
     204
     205            // Get taxes for attachments
    206206            $taxes = get_object_taxonomies( 'attachment' );
    207207            if ( ! empty( $taxes ) ) {
Note: See TracChangeset for help on using the changeset viewer.