Merge branch 'master' of https://github.com/thelia/thelia into coupon
# By Manuel Raynaud (18) and others # Via franck (9) and others * 'master' of https://github.com/thelia/thelia: (39 commits) Working : Working : Working : Working : Fixed minor visual glitches Working : Resize countries flag + Add bootstrap-switch fix test suite clear asset cache in cache:cler command Added a 'development mode' to assetic smarty plugin rewriting router use good Request object Added Tools\URL test case, and a test case superclass for initializing Tools\URL remove unused UrlWritin controller create router for rewriting matching customer substitutions fix typo in front id Working : For attributes on labels Working : For attributes on labels add label_attr attribute to form smarty plugin start refactorin rewriting routing ... Conflicts: core/lib/Thelia/Config/Resources/routing/front.xml templates/admin/default/assets/less/thelia/bootstrap-editable.less templates/admin/default/categories.html
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
namespace Thelia\Constraint;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\Serializer\Encoder\JsonEncoder;
|
||||
use Symfony\Component\Serializer\Encoder\XmlEncoder;
|
||||
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
use Thelia\Constraint\Rule\CouponRuleInterface;
|
||||
use Thelia\Constraint\Rule\SerializableRule;
|
||||
use Thelia\Coupon\CouponAdapterInterface;
|
||||
@@ -102,7 +106,8 @@ class ConstraintManager
|
||||
$serializableRules[] = $rule->getSerializableRule();
|
||||
}
|
||||
}
|
||||
return (string) base64_encode(serialize($serializableRules));
|
||||
|
||||
return base64_encode(json_encode($serializableRules));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +119,8 @@ class ConstraintManager
|
||||
*/
|
||||
public function unserializeCouponRuleCollection($serializedRules)
|
||||
{
|
||||
$unserializedRules = unserialize(base64_decode($serializedRules));
|
||||
$unserializedRules = json_decode(base64_decode($serializedRules));
|
||||
|
||||
$collection = new CouponRuleCollection();
|
||||
|
||||
if (!empty($serializedRules) && !empty($unserializedRules)) {
|
||||
@@ -124,10 +130,10 @@ class ConstraintManager
|
||||
/** @var CouponRuleInterface $couponRule */
|
||||
$couponRule = $this->container->get($rule->ruleServiceId);
|
||||
$couponRule->populateFromForm(
|
||||
$rule->operators,
|
||||
$rule->values
|
||||
(array) $rule->operators,
|
||||
(array) $rule->values
|
||||
);
|
||||
$collection->add($couponRule);
|
||||
$collection->add(clone $couponRule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user