Plugin Directory

Changeset 3012278


Ignore:
Timestamp:
12/20/2023 04:47:30 AM (2 years ago)
Author:
moazsup
Message:

Fixed DB Table issues for specific versions of mysql

Location:
integrate-dynamics-365-crm
Files:
75 added
4 edited

Legend:

Unmodified
Added
Removed
  • integrate-dynamics-365-crm/trunk/View/cf7Config.php

    r2828956 r3012278  
    158158        $rows = [];
    159159        foreach ($db_data as $key => $config) {
     160            $config = (array) $config;
    160161            $id = $config['id'];
    161162            $CF7_form = '<div Style="color:red;font-weight:500">Pending</div>';
  • integrate-dynamics-365-crm/trunk/Wrappers/dbWrapper.php

    r2972531 r3012278  
    3434
    3535        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    36         dbDelta( $sql );
     36        $status = dbDelta( $sql );
    3737    }
    3838
     
    4747
    4848        if($has_old_value){
    49             $wpdb->update( $table, $data, array('id'=>$has_old_value), $format );
     49            $status = $wpdb->update( $table, $data, array('id'=>$has_old_value), $format );
    5050        }else{
    51             $wpdb->insert($table,$data,$format);
     51            $status = $wpdb->insert($table,$data,$format);
    5252        }
    53        
    5453    }
    5554
     
    6867
    6968        $db=$wpdb->dbname;
    70         $id = $wpdb->get_var($wpdb->prepare("SELECT id FROM %i ORDER BY id DESC LIMIT 1", $table));
     69        $query = "SELECT id FROM $table ORDER BY id DESC LIMIT %d";
     70        $id = $wpdb->get_var($wpdb->prepare($query,1));
    7171        $id = $id ? $id : 0;
    72         $result = $wpdb->get_results($wpdb->prepare("ALTER TABLE %i AUTO_INCREMENT = %d", $table,$id), ARRAY_A);
     72        $query = "ALTER TABLE $table AUTO_INCREMENT = %d";
     73        $result = $wpdb->get_results($wpdb->prepare($query,$id), ARRAY_A);
    7374           
    7475        return $id+1;
     
    8485        global $wpdb;
    8586        $table = $wpdb->prefix.dbConstants::CF7_OBJECT_MAPPING_TABLE;
    86         $result = $wpdb->get_results( $wpdb->prepare("SELECT id FROM %i where id = %d",$table,$id));
     87        $query = "SELECT id FROM $table where id = %d";
     88        $result = $wpdb->get_results( $wpdb->prepare($query,$id));
    8789        if(empty($result))
    8890            return false;
     
    9597        global $wpdb;
    9698        $table = $wpdb->prefix.dbConstants::CF7_OBJECT_MAPPING_TABLE;
    97         $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM %i where id = %d",$table,$id), ARRAY_A );
     99        $query = "SELECT * FROM $table where id = %d";
     100        $result = $wpdb->get_results($wpdb->prepare($query,$id), ARRAY_A );
    98101       
    99102        if(empty($result))
     
    107110        global $wpdb;
    108111        $table = $wpdb->prefix.dbConstants::CF7_OBJECT_MAPPING_TABLE;
    109         $result = $wpdb->get_results($wpdb->prepare("SELECT  %i FROM %i where %d = %d",$select, $table,$key, $id), ARRAY_A );
    110        
     112        $query = "SELECT $select FROM $table where $key = %d";
     113        $result = $wpdb->get_results($wpdb->prepare($query,$id), ARRAY_A );
    111114        if(empty($result))
    112115            return [];
     
    122125            return [];
    123126
    124         $result=$wpdb->get_results($wpdb->prepare("SELECT id, cf7_form_id, dynamics_object_id, field_map from %i",$table),ARRAY_A);
     127        $result= $wpdb->get_results("SELECT id, cf7_form_id, dynamics_object_id, field_map from $table");
    125128        return $result;
    126129     }
  • integrate-dynamics-365-crm/trunk/integrate-dynamics-365-crm.php

    r2972531 r3012278  
    55Plugin URI: https://plugins.miniorange.com/
    66Description: This plugin will allow you to sync CRM Objects like contacts, accounts, leads, etc. between Dynamics 365 Sales and wordpress.
    7 Version: 1.0.4
     7Version: 1.0.5
    88Author: miniOrange
    99License: GPLv2 or later
     
    2424define('MO_DCRM_PLUGIN_FILE',__FILE__);
    2525define('MO_DCRM_PLUGIN_DIR',__DIR__.DIRECTORY_SEPARATOR);
    26 define('PLUGIN_VERSION','1.0.4');
     26define('PLUGIN_VERSION','1.0.5');
    2727
    2828class MOdcrm{
  • integrate-dynamics-365-crm/trunk/readme.txt

    r2972531 r3012278  
    44Tags: crm, dynamics 365, dynamics crm, forms, Microsoft
    55Requires at least: 5.5
    6 Tested up to: 6.3
     6Tested up to: 6.4
    77Requires PHP: 7.0 or higher
    8 Stable tag: 1.0.4
     8Stable tag: 1.0.5
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282== ChangeLog ==
    8383
     84= 1.0.5 =
     85* Compatibility with WordPress 6.4
     86* Bug fix for database operations related to mapping functionality.
     87
    8488= 1.0.4 =
    8589* BugFix for contact form 7 mapping table
     
    102106== Upgrade Notice ==
    103107
     108= 1.0.5 =
     109* Compatibility with WordPress 6.4
     110* Bug fix for database operations related to mapping functionality.
     111
    104112= 1.0.4 =
    105113* BugFix for contact form 7 mapping table
Note: See TracChangeset for help on using the changeset viewer.