Skip to content

Commit

Permalink
Merge pull request #130 from jarocks/master
Browse files Browse the repository at this point in the history
[FIX] Mass Select Option Remapper PDO exception error
  • Loading branch information
dweeves committed Oct 13, 2014
2 parents 47d1dfb + 02f8693 commit 425c2fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magmi/plugins/utilities/massopt_remap/mass_selectremap.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ public function remapAttrVal($attid, $from, $to, $cs = true)
{
$csmode = "COLLATE utf8_bin";
}
if (!preg_match("re::(.*)", $from, $matches))
if (!preg_match("/re::(.*)/", $from, $matches))
{
$where = "(SELECT eao.option_id FROM
$eao as eao
JOIN $eaov as eaov ON eaov.option_id=eao.option_id
WHERE eao.attribute_id=? and eaov.value REGEXP '?' $cs)";
WHERE eao.attribute_id=? and eaov.value REGEXP ? $csmode)";
$from = $matches[1];
}
else
{
$where = "(SELECT eao.option_id FROM
$eao as eao
JOIN $eaov as eaov ON eaov.option_id=eao.option_id
WHERE eao.attribute_id=? and eaov.value='?' $cs)";
WHERE eao.attribute_id=? and eaov.value=? $csmode)";
}
$sql = "UPDATE $cpei SET value=(SELECT eao.option_id
FROM $eao as eao
JOIN $eaov as eaov ON eaov.option_id=eao.option_id
WHERE eao.attribute_id=? and eaov.value='?' COLLATE utf8_bin)
WHERE eao.attribute_id=? and eaov.value=? COLLATE utf8_bin)
WHERE value IN $where";
$this->update($sql, array($attid,$to,$attid,$from));
}
Expand Down

0 comments on commit 425c2fd

Please sign in to comment.