Plugin Directory

Changeset 2903228


Ignore:
Timestamp:
04/24/2023 10:00:36 AM (3 years ago)
Author:
supportcandy
Message:

hotfix for upgrade for attchment changes

Location:
supportcandy
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • supportcandy/tags/3.1.6/upgrade/class-wpsc-upgrade-db-v1.php

    r2895888 r2903228  
    37603760                                    array(
    37613761                                        'name'         => $term_meta['filename'][0],
    3762                                         'file_path'    => $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0],
     3762                                        'file_path'    => '/wpsc/' . $term_meta['save_file_name'][0],
    37633763                                        'is_image'     => $term_meta['is_image'][0],
    37643764                                        'is_active'    => 1,
     
    39213921                            array(
    39223922                                'name'         => $term_meta['filename'][0],
    3923                                 'file_path'    => $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0],
     3923                                'file_path'    => '/wpsc/' . $term_meta['save_file_name'][0],
    39243924                                'is_image'     => $term_meta['is_image'][0],
    39253925                                'is_active'    => 1,
     
    40294029                    }
    40304030
     4031                    $file_path = str_replace( $upload_dir['basedir'], '', $file_path );
    40314032                    $file_name = basename( $file_path );
    40324033                    $file_url = $upload_dir['baseurl'] . '/wpsc/' . $matches[1][ $i ];
  • supportcandy/tags/3.1.6/upgrade/class-wpsc-upgrade-db-v2.php

    r2895888 r2903228  
    46874687                                    continue;
    46884688                                }
    4689                                 $filepath = $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0];
     4689                                $filepath = '/wpsc/' . $term_meta['save_file_name'][0];
    46904690                                if ( isset( $term_meta['is_restructured'] ) && $term_meta['is_restructured'][0] ) {
    46914691                                    $updated_time   = $term_meta['time_uploaded'][0];
     
    46934693                                    $month = date( 'm', $time ); // phpcs:ignore
    46944694                                    $year  = date( 'Y', $time ); // phpcs:ignore
    4695                                     $filepath = $upload_dir['basedir'] . '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
     4695                                    $filepath = '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
    46964696                                }
    46974697                                $wpdb->insert(
     
    48884888                        }
    48894889
    4890                         $filepath = $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0];
     4890                        $filepath = '/wpsc/' . $term_meta['save_file_name'][0];
    48914891                        if ( isset( $term_meta['is_restructured'] ) && $term_meta['is_restructured'][0] ) {
    48924892                            $updated_time   = $term_meta['time_uploaded'][0];
     
    48944894                            $month = date( 'm', $time ); // phpcs:ignore
    48954895                            $year  = date( 'Y', $time ); // phpcs:ignore
    4896                             $filepath = $upload_dir['basedir'] . '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
     4896                            $filepath = '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
    48974897                        }
    48984898
     
    51155115                        continue;
    51165116                    }
     5117
     5118                    $file_path = str_replace( $upload_dir['basedir'], '', $file_path );
    51175119                    $file_name = basename( $file_path );
    51185120
  • supportcandy/trunk/upgrade/class-wpsc-upgrade-db-v1.php

    r2873748 r2903228  
    37603760                                    array(
    37613761                                        'name'         => $term_meta['filename'][0],
    3762                                         'file_path'    => $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0],
     3762                                        'file_path'    => '/wpsc/' . $term_meta['save_file_name'][0],
    37633763                                        'is_image'     => $term_meta['is_image'][0],
    37643764                                        'is_active'    => 1,
     
    39213921                            array(
    39223922                                'name'         => $term_meta['filename'][0],
    3923                                 'file_path'    => $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0],
     3923                                'file_path'    => '/wpsc/' . $term_meta['save_file_name'][0],
    39243924                                'is_image'     => $term_meta['is_image'][0],
    39253925                                'is_active'    => 1,
     
    40294029                    }
    40304030
     4031                    $file_path = str_replace( $upload_dir['basedir'], '', $file_path );
    40314032                    $file_name = basename( $file_path );
    40324033                    $file_url = $upload_dir['baseurl'] . '/wpsc/' . $matches[1][ $i ];
  • supportcandy/trunk/upgrade/class-wpsc-upgrade-db-v2.php

    r2873748 r2903228  
    46874687                                    continue;
    46884688                                }
    4689                                 $filepath = $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0];
     4689                                $filepath = '/wpsc/' . $term_meta['save_file_name'][0];
    46904690                                if ( isset( $term_meta['is_restructured'] ) && $term_meta['is_restructured'][0] ) {
    46914691                                    $updated_time   = $term_meta['time_uploaded'][0];
     
    46934693                                    $month = date( 'm', $time ); // phpcs:ignore
    46944694                                    $year  = date( 'Y', $time ); // phpcs:ignore
    4695                                     $filepath = $upload_dir['basedir'] . '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
     4695                                    $filepath = '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
    46964696                                }
    46974697                                $wpdb->insert(
     
    48884888                        }
    48894889
    4890                         $filepath = $upload_dir['basedir'] . '/wpsc/' . $term_meta['save_file_name'][0];
     4890                        $filepath = '/wpsc/' . $term_meta['save_file_name'][0];
    48914891                        if ( isset( $term_meta['is_restructured'] ) && $term_meta['is_restructured'][0] ) {
    48924892                            $updated_time   = $term_meta['time_uploaded'][0];
     
    48944894                            $month = date( 'm', $time ); // phpcs:ignore
    48954895                            $year  = date( 'Y', $time ); // phpcs:ignore
    4896                             $filepath = $upload_dir['basedir'] . '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
     4896                            $filepath = '/wpsc/' . $year . '/' . $month . '/' . $term_meta['save_file_name'][0];
    48974897                        }
    48984898
     
    51155115                        continue;
    51165116                    }
     5117
     5118                    $file_path = str_replace( $upload_dir['basedir'], '', $file_path );
    51175119                    $file_name = basename( $file_path );
    51185120
Note: See TracChangeset for help on using the changeset viewer.