Jake Vanderwerf
2026-08-25 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a
inc/registrar/helpers/AddIntegrationFields.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\registrar\helpers;
use JVBase\integrations\ServiceMap;
use JVBase\registrar\config\Integration;
use JVBase\registrar\Registrar;
use JVBase\base\Site;
@@ -10,6 +11,7 @@
}
class AddIntegrationFields {
   use ServiceMap;
   protected string $service_name;
   private Registrar $registrar;
   protected Integration $config;
@@ -65,6 +67,10 @@
   public function getIntegrationFields():array
   {
      if (!$this->getService($this->service_name)) {
         error_log('Attempted to connect to unsupported service: '.$this->service_name);
         return [];
      }
      $fields = [
         'share_to_'.$this->service_name => [
            'type'   => 'true_false',
@@ -131,7 +137,8 @@
            'default'   => 1,
         ];
      }
      $additional = JVB()->connect($this->service_name)->getAdditionalFields($this->config->getContentType());
      $additional = $this->getService($this->service_name)->getAdditionalFields($this->config->getContentType());
      if (!empty($additional)) {
         $additional = array_combine(
            array_map(fn($k) => str_starts_with($k, '_'.$this->service_name) ? $k : "_{$this->service_name}_{$k}", array_keys($additional)),