From 342bf5dcca16d66d8ffbbcf9e8a62344062e444e Mon Sep 17 00:00:00 2001
From: Dieter Holvoet <dieter.holvoet@gmail.com>
Date: Mon, 17 Feb 2025 13:54:51 +0100
Subject: [PATCH] Check whether the view entity is new before trying to
 generate an url

---
 src/Plugin/views/display/DataExport.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/Plugin/views/display/DataExport.php b/src/Plugin/views/display/DataExport.php
index c08dbce..be8a242 100644
--- a/src/Plugin/views/display/DataExport.php
+++ b/src/Plugin/views/display/DataExport.php
@@ -560,7 +560,9 @@ class DataExport extends RestExport {
     }
 
     if ($plugin = $clone->display_handler->getPlugin('style')) {
-      $plugin->attachTo($build, $display_id, $clone->getUrl(), $title);
+      if (!$clone->storage->isNew()) {
+        $plugin->attachTo($build, $display_id, $clone->getUrl(), $title);
+      }
       foreach ($clone->feedIcons as $feed_icon) {
         $this->view->feedIcons[] = $feed_icon;
       }
-- 
GitLab