bug fixing
ccode homonym companies terms tel to long set to memo instead of phone field Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
@@ -61,7 +61,7 @@ class MaterioMateriauNodeMigration extends MaterioBasicMigration {
|
||||
$this->addFieldMapping('status')->defaultValue(1);
|
||||
$this->addFieldMapping('promote')->defaultValue(0);
|
||||
$this->addFieldMapping('sticky')->defaultValue(0);
|
||||
$this->addFieldMapping('language')->defaultValue('fr');
|
||||
$this->addFieldMapping('language')->defaultValue('en');
|
||||
|
||||
$this->addFieldMapping('title', 'title');
|
||||
$this->addFieldMapping('field_memo', 'memo');
|
||||
@@ -100,7 +100,7 @@ class MaterioMateriauNodeMigration extends MaterioBasicMigration {
|
||||
public function prepareRow($cr){
|
||||
// dsm($cr);
|
||||
|
||||
# parse product infos
|
||||
# get product infos FR
|
||||
$infos_fr = db_select(MIG_MAT_SRC_DB .'.product_info', 'pif_fr')
|
||||
->condition('pif_fr.id_locale', 2)
|
||||
->condition('pif_fr.id_product', $cr->id_product)
|
||||
@@ -112,7 +112,8 @@ class MaterioMateriauNodeMigration extends MaterioBasicMigration {
|
||||
|
||||
if($infos['fr']->technical != '')
|
||||
$infos['fr']->description .= "<br />technical : ".$infos['fr']->technical; // . "<br />usage".$infos['fr']->usage
|
||||
|
||||
|
||||
# get product infos EN
|
||||
$infos_en = db_select(MIG_MAT_SRC_DB .'.product_info', 'pif_en')
|
||||
->condition('pif_en.id_locale', 1)
|
||||
->condition('pif_en.id_product', $cr->id_product)
|
||||
@@ -124,17 +125,17 @@ class MaterioMateriauNodeMigration extends MaterioBasicMigration {
|
||||
|
||||
if($infos['en']->technical != '')
|
||||
$infos['en']->description .= "<br />technical : ".$infos['en']->technical; // . "<br />usage".$infos['en']->usage
|
||||
|
||||
|
||||
# set product infos
|
||||
$cr->title = $infos['fr']->name;
|
||||
$cr->name = array($infos['en']->name, $infos['fr']->name);
|
||||
$cr->description = array($infos['en']->description, $infos['fr']->description);
|
||||
$cr->nature = array($infos['en']->nature, $infos['fr']->nature);
|
||||
$cr->language = array('en', 'fr');
|
||||
|
||||
#record keywords on memo
|
||||
# record keywords on memo
|
||||
$cr->memo .= ($cr->memo != '' ? "\n\n" : '') . $infos['fr']->keywords;
|
||||
|
||||
|
||||
# parse companies
|
||||
// dsm($cr->list_industrial, '-- $cr->list_industrial');
|
||||
// dsm($cr->list_quarity, '$cr->list_quarity');
|
||||
@@ -154,9 +155,8 @@ class MaterioMateriauNodeMigration extends MaterioBasicMigration {
|
||||
foreach ($result as $record) {
|
||||
// dsm($record);
|
||||
$company = trim($record->company);
|
||||
$same_comp = taxonomy_get_term_by_name($company);
|
||||
if(count($same_comp))
|
||||
$company .= '-'.$record->id_industrial;
|
||||
if(count(taxonomy_get_term_by_name($company.'-'.$record->id_industrial)))
|
||||
$company .= '-'.$record->id_industrial;
|
||||
|
||||
if($quarities[$i] == 'M'){
|
||||
$companies_fab[] = $company;
|
||||
|
||||
Reference in New Issue
Block a user