You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (Z_TYPE_P(data) != IS_ARRAY) {
ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The snapshot data must be an array", "phalcon/mvc/model.zep", 3617);
return;
}
diff --git a/phalcon/mvc/model.zep b/phalcon/mvc/model.zep
index 0defc80..f213246 100644
--- a/phalcon/mvc/model.zep
+++ b/phalcon/mvc/model.zep
@@ -3613,7 +3613,7 @@ abstract class Model implements ModelInterface, ResultInterface, InjectionAwareI
{
var key, value, snapshot, attribute;
if typeof data == "array" {
if typeof data != "array" {
throw new Exception("The snapshot data must be an array");
}
The text was updated successfully, but these errors were encountered:
When using $this->useDynamicUpdate(true); in a model class the exception "The snapshot data must be an array" is raised.
This is due to an inverted test in Model.zep (and the generated model.c).
Here is the patch :
index 7be257d..8cb0bbf 100644
--- a/ext/phalcon/mvc/model.c
+++ b/ext/phalcon/mvc/model.c
@@ -4615,7 +4615,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) {
}
diff --git a/phalcon/mvc/model.zep b/phalcon/mvc/model.zep
index 0defc80..f213246 100644
--- a/phalcon/mvc/model.zep
+++ b/phalcon/mvc/model.zep
@@ -3613,7 +3613,7 @@ abstract class Model implements ModelInterface, ResultInterface, InjectionAwareI
{
var key, value, snapshot, attribute;
The text was updated successfully, but these errors were encountered: