diff --git a/magmi/engines/magmi_productimportengine.php b/magmi/engines/magmi_productimportengine.php
index 510912bf..e9b3221f 100755
--- a/magmi/engines/magmi_productimportengine.php
+++ b/magmi/engines/magmi_productimportengine.php
@@ -419,8 +419,11 @@ public function getMode()
*/
public function addExtraAttribute($attr)
{
- $attinfo = $this->attrinfo[$attr];
- $this->_extra_attrs[$attinfo["backend_type"]]["data"][] = $attinfo;
+ if(isset($this->attrinfo[$attr]))
+ {
+ $attinfo = $this->attrinfo[$attr];
+ $this->_extra_attrs[$attinfo["backend_type"]]["data"][] = $attinfo;
+ }
}
/**
diff --git a/magmi/inc/magmi_config.php b/magmi/inc/magmi_config.php
index 844a19e8..b2672942 100755
--- a/magmi/inc/magmi_config.php
+++ b/magmi/inc/magmi_config.php
@@ -63,7 +63,7 @@ public function getLastSaved($fmt = "r")
public function load($name = null)
{
- if (!isset($this->_props)) {
+ if (!isset($this->_props) || empty($this->_props)) {
if ($name == null) {
$name = $this->inifile;
}
diff --git a/magmi/inc/remotefilegetter.php b/magmi/inc/remotefilegetter.php
index 066674b0..15d4bce1 100644
--- a/magmi/inc/remotefilegetter.php
+++ b/magmi/inc/remotefilegetter.php
@@ -262,6 +262,8 @@ public function getRemoteFile($url, $dest, $authmode = null, $cookies = null)
$context = $this->createContext($url);
$ch = $context['curlhandle'];
$dl_opts = $context['opts']['dl'];
+
+ $dest = str_replace("pub/pub", "pub", $dest);
$outname = $dest;
if ($cookies) {
@@ -279,7 +281,6 @@ public function getRemoteFile($url, $dest, $authmode = null, $cookies = null)
$this->setURLOptions($url, $dl_opts);
$this->setAuthOptions($context, $dl_opts);
-
// Download the file , force expect to nothing to avoid buffer save problem
curl_setopt_array($ch, $dl_opts);
$inf = curl_getinfo($ch);
diff --git a/magmi/plugins/5b5/general/attributesetimport/csvds_filelist.php b/magmi/plugins/5b5/general/attributesetimport/csvds_filelist.php
index a3523738..75a5d8da 100644
--- a/magmi/plugins/5b5/general/attributesetimport/csvds_filelist.php
+++ b/magmi/plugins/5b5/general/attributesetimport/csvds_filelist.php
@@ -25,4 +25,4 @@
?>
No csv files found in getScanDir(false)?>
\ No newline at end of file
+ }?>
diff --git a/magmi/plugins/5b5/general/attributesetimport/javascript.php b/magmi/plugins/5b5/general/attributesetimport/javascript.php
index 47fcdc86..2e20eb87 100644
--- a/magmi/plugins/5b5/general/attributesetimport/javascript.php
+++ b/magmi/plugins/5b5/general/attributesetimport/javascript.php
@@ -88,4 +88,4 @@
$(':update_cb').observe('click',showHideAttributeGroups);
-
\ No newline at end of file
+
diff --git a/magmi/plugins/5b5/general/attributesetimport/name2id_decoding.php b/magmi/plugins/5b5/general/attributesetimport/name2id_decoding.php
index 382829b2..a474ce4c 100644
--- a/magmi/plugins/5b5/general/attributesetimport/name2id_decoding.php
+++ b/magmi/plugins/5b5/general/attributesetimport/name2id_decoding.php
@@ -83,7 +83,6 @@ public function decode($record)
$indexedResult[] = $mappingTable[$values];
} else {
$indexedResult[] = $record[$columnName];
- error_log("Mapped value not found for column $columnName for name(s): ".print_r($values, true));
}
}
}
diff --git a/magmi/plugins/base/datasources/csv/csvds_filelist.php b/magmi/plugins/base/datasources/csv/csvds_filelist.php
index 9a5fb09d..ca985f8c 100755
--- a/magmi/plugins/base/datasources/csv/csvds_filelist.php
+++ b/magmi/plugins/base/datasources/csv/csvds_filelist.php
@@ -17,4 +17,4 @@
?>
No csv files found in getScanDir(false)?>
\ No newline at end of file
+ }?>
diff --git a/magmi/plugins/base/general/reindex/options_panel.php b/magmi/plugins/base/general/reindex/options_panel.php
index c424c0fd..5138db85 100644
--- a/magmi/plugins/base/general/reindex/options_panel.php
+++ b/magmi/plugins/base/general/reindex/options_panel.php
@@ -17,8 +17,8 @@
href="#REINDEX:config" onclick="fcheck(0)">None
\ No newline at end of file
+
diff --git a/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php b/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php
index 50519fcf..45ce0272 100644
--- a/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php
+++ b/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php
@@ -23,6 +23,7 @@ public function initialize($params)
$this->magdir = Magmi_Config::getInstance()->getMagentoDir();
$this->_mdh = MagentoDirHandlerFactory::getInstance()->getHandler($this->magdir);
$this->_mdh->setRemoteGetterId("image");
+
// remote root
if ($this->getParam("IMG:remoteroot", "")) {
if ($this->getParam("IMG:remoteauth", false) == true) {
@@ -482,13 +483,19 @@ public function copyImageFile($imgfile, &$item, $extra)
// magento image value (relative to media catalog)
$impath = "/$i1/$i2/$bimgfile";
// target directory;
- $l2d = "pub/media/catalog/product/$i1/$i2";
+
+ if(!strstr(getcwd(), "pub"))
+ $l2d = "pub/media/catalog/product/$i1/$i2";
+ else
+ $l2d = "media/catalog/product/$i1/$i2";
// test for existence
$targetpath = "$l2d/$bimgfile";
+
/* test for same image (without problem) */
if ($impath == $this->_lastimage) {
return $impath;
}
+
/* test if imagefile comes from export */
if (!$this->_mdh->file_exists($targetpath) || $this->getParam("IMG:writemode") == "override") {
// if we already had problems with this target,assume we'll get others.
diff --git a/magmi/plugins/extra/itemprocessors/itemindexer/options_panel.php b/magmi/plugins/extra/itemprocessors/itemindexer/options_panel.php
index 7adad2ff..62ab63df 100644
--- a/magmi/plugins/extra/itemprocessors/itemindexer/options_panel.php
+++ b/magmi/plugins/extra/itemprocessors/itemindexer/options_panel.php
@@ -27,4 +27,4 @@
-
\ No newline at end of file
+
diff --git a/magmi/plugins/inc/magmi_plugin.php b/magmi/plugins/inc/magmi_plugin.php
index 60734b10..62ba1a3d 100644
--- a/magmi/plugins/inc/magmi_plugin.php
+++ b/magmi/plugins/inc/magmi_plugin.php
@@ -143,7 +143,7 @@ public function setParam($pname, $value)
public function fixListParam($pvalue)
{
- $iarr = explode(",", $pvalue);
+ $iarr = explode(",", $pvalue ?? '');
$oarr = array();
foreach ($iarr as $v) {
if ($v != "") {
diff --git a/magmi/plugins/utilities/clearcustomers/clearcustomers.php b/magmi/plugins/utilities/clearcustomers/clearcustomers.php
index c07bfa9c..566114da 100644
--- a/magmi/plugins/utilities/clearcustomers/clearcustomers.php
+++ b/magmi/plugins/utilities/clearcustomers/clearcustomers.php
@@ -14,8 +14,8 @@ public function runUtility()
$tables = array("customer_address_entity","customer_address_entity_datetime","customer_address_entity_decimal",
"customer_address_entity_int","customer_address_entity_text","customer_address_entity_varchar",
"customer_entity","customer_entity_datetime","customer_entity_decimal","customer_entity_int",
- "customer_entity_text","customer_entity_varchar","tag","tag_properties","tag_relation","wishlist",
- "wishlist_item","wishlist_item_option","log_customer");
+ "customer_entity_text","customer_entity_varchar","wishlist",
+ "wishlist_item","wishlist_item_option","customer_log");
foreach ($tables as $table) {
$this->exec_stmt("TRUNCATE TABLE `" . $this->tablename($table) . "`");
diff --git a/magmi/plugins/utilities/clearproducts/clearproduct.php b/magmi/plugins/utilities/clearproducts/clearproduct.php
index 6fb9b5d5..428707b5 100644
--- a/magmi/plugins/utilities/clearproducts/clearproduct.php
+++ b/magmi/plugins/utilities/clearproducts/clearproduct.php
@@ -11,19 +11,39 @@ public function runUtility()
{
$sql = "SET FOREIGN_KEY_CHECKS = 0";
$this->exec_stmt($sql);
- $tables = array("catalog_product_bundle_option","catalog_product_bundle_option_value",
- "catalog_product_bundle_selection","catalog_product_entity_datetime","catalog_product_entity_decimal",
- "catalog_product_entity_gallery","catalog_product_entity_int","catalog_product_entity_media_gallery",
- "catalog_product_entity_media_gallery_value","catalog_product_entity_text",
- "catalog_product_entity_tier_price","catalog_product_entity_varchar","catalog_product_entity",
- "catalog_product_option","catalog_product_option_price","catalog_product_option_title",
- "catalog_product_option_type_price","catalog_product_option_type_title","catalog_product_option_type_value",
- "catalog_product_super_attribute_label","catalog_product_super_attribute_pricing",
- "catalog_product_super_attribute","catalog_product_super_link","catalog_product_link",
- "catalog_product_link_attribute_varchar","catalog_product_link_attribute_int",
- "catalog_product_entity_group_price",
-
- "catalog_product_relation","catalog_product_enabled_index","catalog_product_website",
+ $tables = array("catalog_product_bundle_option",
+ "catalog_product_bundle_option_value",
+ "catalog_product_bundle_selection",
+ "catalog_product_entity_datetime",
+ "catalog_product_entity_decimal",
+ "catalog_product_entity_int",
+ "catalog_product_entity_gallery",
+ "catalog_product_entity_media_gallery",
+ "catalog_product_entity_media_gallery_value",
+ "catalog_product_entity_media_gallery_value_to_entity",
+ "catalog_product_entity_media_gallery_value_video",
+ "catalog_product_entity_text",
+ "catalog_product_entity_tier_price",
+ "catalog_product_entity_varchar",
+ "catalog_product_entity",
+ "catalog_product_option",
+ "catalog_product_option_price",
+ "catalog_product_option_title",
+ "catalog_product_option_type_price",
+ "catalog_product_option_type_title",
+ "catalog_product_option_type_value",
+ "catalog_product_super_attribute_label",
+ //"catalog_product_super_attribute_pricing",
+ "catalog_product_super_attribute",
+ "catalog_product_super_link",
+ "catalog_product_link",
+ "catalog_product_link_attribute_varchar",
+ "catalog_product_link_attribute_int",
+ //"catalog_product_entity_group_price",
+
+ "catalog_product_relation",
+ //"catalog_product_enabled_index",
+ "catalog_product_website",
"catalog_category_product_index","catalog_category_product","cataloginventory_stock_item",
"cataloginventory_stock_status");
@@ -38,7 +58,8 @@ public function runUtility()
}
//clean url rewrites for products
- $sql = "DELETE FROM ".$this->tablename("core_url_rewrite")." WHERE product_id IS NOT NULL AND is_system=1";
+ //$sql = "DELETE FROM ".$this->tablename("core_url_rewrite")." WHERE product_id IS NOT NULL AND is_system=1";
+ $sql = "DELETE FROM ".$this->tablename("url_rewrite")." WHERE entity_id IS NOT NULL AND is_autogenerated=1";
$this->delete($sql);
$sql = "SET FOREIGN_KEY_CHECKS = 1";
diff --git a/magmi/plugins/utilities/massopt_translate/csvds_filelist.php b/magmi/plugins/utilities/massopt_translate/csvds_filelist.php
index f6638167..779cf06c 100755
--- a/magmi/plugins/utilities/massopt_translate/csvds_filelist.php
+++ b/magmi/plugins/utilities/massopt_translate/csvds_filelist.php
@@ -18,4 +18,4 @@
?>
No csv files found in getScanDir(false)?>
\ No newline at end of file
+ }?>
diff --git a/magmi/web/magmi_progress.php b/magmi/web/magmi_progress.php
index 716e7880..7f6affd5 100755
--- a/magmi/web/magmi_progress.php
+++ b/magmi/web/magmi_progress.php
@@ -184,4 +184,4 @@ class='log_end getData("error")) > 0) {
-
\ No newline at end of file
+
diff --git a/magmi/web/magmi_web_utils.php b/magmi/web/magmi_web_utils.php
index 6c06c912..de14eb52 100644
--- a/magmi/web/magmi_web_utils.php
+++ b/magmi/web/magmi_web_utils.php
@@ -3,10 +3,10 @@
function tdarray_to_js($container, $mainarr, $prefix)
{
$varr = array();
- $vlist = explode(",", $container->getParam($mainarr));
+ $vlist = explode(",", $container->getParam($mainarr) ?? '');
foreach ($vlist as $k) {
$v = $container->getParam("$prefix:" . rawurlencode($k));
- $v = addslashes($v);
+ $v = addslashes($v ?? '');
$varr[] = "\"$k\":\"$v\"";
}
return "{" . implode(",", $varr) . "}";
diff --git a/magmi/web/progress_details.php b/magmi/web/progress_details.php
index ee3d7138..4a46c72c 100644
--- a/magmi/web/progress_details.php
+++ b/magmi/web/progress_details.php
@@ -51,4 +51,4 @@
}
}
?>
-
\ No newline at end of file
+
diff --git a/magmi/web/progress_parser.php b/magmi/web/progress_parser.php
index 17f1932f..a8ea076c 100644
--- a/magmi/web/progress_parser.php
+++ b/magmi/web/progress_parser.php
@@ -112,12 +112,12 @@ public function parseData($type, $info)
}
$this->setData("$type:count", $dcount);
if ($delapsed > 0) {
- $this->setData("$type:speed", ceil(($dcount * 60) / $delapsed));
+ $this->setData("$type:speed", ceil(($dcount * 60) / (double)$delapsed));
} else {
$this->setData("$type:speed", 0);
}
- $this->setData("$type:elapsed", round($delapsed, 4));
+ $this->setData("$type:elapsed", round((double)$delapsed, 4));
$this->setData("$type:incelapsed", round($dlastinc, 4));
break;
case "columns":