Skip to content
Snippets Groups Projects

Issue #3187004 by a.dmitriiev, mohit_aghera: DrupalDateTime serialization issue

Open Issue #3187004 by a.dmitriiev, mohit_aghera: DrupalDateTime serialization issue
2 unresolved threads
Open Artem Dmitriiev requested to merge issue/drupal-3187004:3187004-drupal9-rebased into 9.3.x
2 unresolved threads

Closes #3187004

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
168 173
174 /**
175 * {@inheritdoc}
176 */
177 public function __sleep() {
178 return array_diff($this->defaultSleep(), ['formatTranslationCache']);
179 }
180
181 /**
182 * {@inheritdoc}
183 */
184 public function __wakeup() {
185 $this->defaultWakeup();
186 $this->formatTranslationCache = [];
187 }
188
  • 166 171 return $value;
    167 172 }
    168 173
    174 /**
    175 * {@inheritdoc}
    176 */
    177 public function __sleep() {
    178 return array_diff($this->defaultSleep(), ['formatTranslationCache']);
    179 }
    180
    • Comment on lines +174 to +180

      This class really doesn't need any of the service detection magic. Lets just do this and get rid of the trait.

          $vars = get_object_vars($this);
          unset($vars['formatTranslationCache']);
          // return $vars;
          return array_keys($vars);
      Edited by James Gilliland
    • This does need the DependencySerializationTrait for the service "string_translation" stored in protected $stringTranslation

    • Please register or sign in to reply
    Please register or sign in to reply
    Loading