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
Assign $configHash after "Nasty elements index hack"
Added elements/save-draft and elements/apply-draft to "Nasty elements index hack" actions array
diff -rupN a/packages/plugin/src/Elements/Db/EventQuery.php b/packages/plugin/src/Elements/Db/EventQuery.php--- a/packages/plugin/src/Elements/Db/EventQuery.php 2024-09-10 14:54:54.949241583 -0400+++ b/packages/plugin/src/Elements/Db/EventQuery.php 2024-09-10 14:58:23.735754716 -0400@@ -364,8 +364,6 @@ class EventQuery extends ElementQuery
return parent::all();
}
- $configHash = $this->getConfigStateHash();-
// Nasty elements index hack
if (!\Craft::$app->request->isConsoleRequest) {
$context = \Craft::$app->request->post('context');
@@ -374,11 +372,13 @@ class EventQuery extends ElementQuery
}
// If we save an event via the events edit page or via the slide out panel, dont use the cached events
$action = \Craft::$app->request->post('action');
- if (\in_array($action, ['elements/save', 'calendar/events/save-event'], true)) {+ if (\in_array($action, ['elements/apply-draft', 'elements/save', 'elements/save-draft', 'calendar/events/save-event'], true)) {
return parent::all();
}
}
+ $configHash = $this->getConfigStateHash();+
if (null === $this->events || self::$lastCachedConfigStateHash !== $configHash) {
$limit = $this->limit;
$offset = $this->offset;
But our production environment was still throwing the serialization exception, the only difference is that the production instance has revisions and is on Craft v5.4.1. So I ended up writing a new patch that caught getConfigStateHash exceptions:
We are experiencing the exact same issue. I tried to implement these changes but the error continued.
Craft v5.4.2
Calendar v5.0.7
Calendar Edition: Pro
I have determined this issue was introduced with Craft v 5.4.0. I have tried 5.4.2, 5.4.1, 5.4.0 and each one had the same issue.
Describe the bug or issue you're experiencing
Events field cannot be saved due to serialization issue.
Screencast of issue
Screencast.from.2024-09-10.14-48-49.mp4
Steps to reproduce
Stack trace
Craft & Plugin Info (please complete the following information):
Additional context
I was able to temporarily get around this issue locally with the following changes to https://github.com/solspace/craft-calendar/blob/v5/packages/plugin/src/Elements/Db/EventQuery.php:
$configHash
after "Nasty elements index hack"elements/save-draft
andelements/apply-draft
to "Nasty elements index hack" actions arrayBut our production environment was still throwing the serialization exception, the only difference is that the production instance has revisions and is on Craft v5.4.1. So I ended up writing a new patch that caught
getConfigStateHash
exceptions:The text was updated successfully, but these errors were encountered: