Goal of test was to know if data into source file is an id or a ref we must use to get id. I didn't find better solution that this test.
2014-07-10 17:09 GMT+02:00 Maxime Kohlhaas <[email protected]>: > I think this import takes product ref because it's defined in the category > mod : > > $this->import_convertvalue_array[$r]=array( > > 'cp.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'), > > 'cp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'product') > ); > > It works perfectly fine if my product is not a numeric... > > > > Bien cordialement, > > -- > > > *Maxime KohlhaasConsultant associé**ATM Consulting* > *+33 6 33 42 92 43 <%2B33%206%2033%2042%2092%2043>* > > > 2014-07-10 17:01 GMT+02:00 Marcos García <[email protected]>: > > Because there's no support to Product Ref in some import wizards, they use >> Product Id. >> >> Regards, >> >> >> *Marcos García* >> >> [email protected] >> >> >> >> 2014-07-10 16:59 GMT+02:00 Maxime Kohlhaas <[email protected]>: >> >>> Hi all ! >>> >>> I just had trouble with the import module. >>> I was trying to import link betwwen product and category but the system >>> was not transforming my product ref into id to do the insert. >>> >>> After a little digging, i found that in the import_csv.modules.php file >>> (core/modules/import), there's a test : >>> >>> if (! is_numeric($newval) && $newval != '') >>> >>> This test doesn't fetch the object if the ref ($newval) is a numeric. >>> But I can have perfectly numeric product refs. >>> >>> I was wondering why this is_numeric() test is made... >>> >>> Regards, >>> >>> -- >>> >>> >>> *Maxime KohlhaasConsultant associé**ATM Consulting* >>> *+33 6 33 42 92 43 <%2B33%206%2033%2042%2092%2043>* >>> >>> _______________________________________________ >>> Dolibarr-dev mailing list >>> [email protected] >>> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev >>> >>> >> >> _______________________________________________ >> Dolibarr-dev mailing list >> [email protected] >> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev >> >> > > _______________________________________________ > Dolibarr-dev mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/dolibarr-dev > > -- Laurent Destailleur (alias Eldy) ------------------------------------------------------------------------------------ Social networks of my OpenSource projects: Dolibarr Google+: https://plus.google.com/+DolibarrOrg/ Dolibarr Facebook: https://www.facebook.com/dolibarr Dolibarr Twitter: http://www.twitter.com/dolibarr AWStats Google+: https://plus.google.com/+AWStatsOrgPoject/ AWStats Facebook: https://www.facebook.com/awstats.org AWStats Twitter: http://www.twitter.com/awstats_project
_______________________________________________ Dolibarr-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
