Cast metadata to string, as it would hit deprecation notice on null
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 27 Mar 2023 20:08:02 +0000 (09:08 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 27 Mar 2023 20:08:02 +0000 (09:08 +1300)
ext/civiimport/Civi/Api4/Event/Subscriber/ImportSubscriber.php

index 069fc9f272f7fedf460921c681f86cc17cb3c42c..34c7381407951cbdf303beb58633fe87f3cf124f 100644 (file)
@@ -122,7 +122,7 @@ class ImportSubscriber extends AutoService implements EventSubscriberInterface {
    */
   private function getImportTableFromEvent(GenericHookEvent $event): ?string {
     if (isset($event->object)) {
-      $metadata = json_decode($event->object->metadata, TRUE);
+      $metadata = json_decode((string) $event->object->metadata, TRUE);
       if (!is_array($metadata)) {
         return NULL;
       }