Improvements to class\CustomField.php

Details of modifications which users can incorporate within Enuuk Auction Platform free of charge
Post Reply
RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Improvements to class\CustomField.php

Post by RWAP » Tue Oct 18, 2011 3:05 pm

There is a minor improvement to be made to class\CustomField.php in the function saveToDB().

Look for the lines:

Code: Select all

            // deleting all existing data in DB_LANGUAGE_TABLE
            $sql = 'delete from '.self::DB_LANGUAGE_TABLE.' where userFieldId="'.$this->_id.'"';
            $DB->query($sql);

            foreach($this->_name as $k=>$v){
                if($v){
                    $queryLangInsert = $DB->prepare($sqlLangInsert);
                    $result&=$queryLangInsert->execute(array(':id'=>$this->_id,':lang'=>$k,':name'=>$v,':notes'=>$this->_notes[$k]));
                    unset($queryLangInsert);
                }
            }
Change this to read:

Code: Select all

            // deleting all existing data in DB_LANGUAGE_TABLE
            $sql = 'delete from '.self::DB_LANGUAGE_TABLE.' where userFieldId="'.$this->_id.'"';
            $DB->query($sql);

            $queryLangInsert = $DB->prepare($sqlLangInsert);
            $id=$this->_id;
            foreach($this->_name as $k=>$v){
                if($v){
                    $result&=$queryLangInsert->execute(array(':id'=>$id,':lang'=>$k,':name'=>$v,':notes'=>$this->_notes[$k]));
                }
            }
            unset($queryLangInsert);
A similar change can be made to class\CustomOfferField.php, again in the function saveToDB().

Find:

Code: Select all

            // deleting all existing data in DB_LANGUAGE_TABLE
            $sql = 'delete from '.self::DB_LANGUAGE_TABLE.' where auctionFieldId="'.$this->_id.'"';
            $DB->query($sql);

            foreach($this->_name as $k=>$v){
                if($v){
                    $queryLangInsert = $DB->prepare($sqlLangInsert);
                    $result&=$queryLangInsert->execute(array(':id'=>$this->_id,':lang'=>$k,':name'=>$v,':notes'=>$this->_notes[$k]));
                    unset($queryLangInsert);
                }
            }
Change this to read:

Code: Select all

            // deleting all existing data in DB_LANGUAGE_TABLE
            $sql = 'delete from '.self::DB_LANGUAGE_TABLE.' where auctionFieldId="'.$this->_id.'"';
            $DB->query($sql);

            $queryLangInsert = $DB->prepare($sqlLangInsert);
            $id=$this->_id;
            foreach($this->_name as $k=>$v){
                if($v){
                    $result&=$queryLangInsert->execute(array(':id'=>$id,':lang'=>$k,':name'=>$v,':notes'=>$this->_notes[$k]));
                }
            }
            unset($queryLangInsert);

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Improvements to class\CustomField.php

Post by RWAP » Mon Feb 06, 2012 4:41 pm

These have been incorporated in v2.10 of Enuuk

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest