Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Updating a category can yield an invalid project config which errors when running a migration #60

Open
joepagan opened this issue Jul 6, 2021 · 0 comments

Comments

@joepagan
Copy link

joepagan commented Jul 6, 2021

Hey, just found that if I update a category, removing an existing uriFormat, the project config files will update as follows:

+++ b/craft/config/project/categoryGroups/sectors--fdd1be2c-d545-4af2-9d6a-3a1bb2082e31.yaml
@@ -291,9 +291,9 @@ handle: sectors
 name: Sectors
 siteSettings:
   146e7a6b-f0ca-4f39-ba5d-d9eb009fc426: # UDL (en-GB)
-    hasUrls: true
-    template: sectors/_category
-    uriFormat: '{% if object.level == 1 %}sectors/{slug}{% else %}{parent.uri}/{slug}{% endif %}'
+    hasUrls: false
+    template: null
+    uriFormat: null
 structure:
   maxLevels: null
   uid: 0cc96d4e-d9ac-4f49-bc9d-db9e145926de
diff --git a/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml b/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml
index b8d2cce2..13a98673 100644
--- a/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml
+++ b/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml
@@ -1,4 +1,4 @@
 changefreq: weekly
-linkId: fdd1be2c-d545-4af2-9d6a-3a1bb2082e31 # Sectors
+linkId: null
 priority: 0.5
 type: category
diff --git a/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml b/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml
index 8256fc35..30ccf941 100644
--- a/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml
+++ b/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml
@@ -1,4 +1,4 @@
 changefreq: weekly
-linkId: c22c47f9-3b49-43b0-906d-a7ae8fcf36ba # International
+linkId: cbcce34a-495a-4916-8335-8d4a3217d194
 priority: 0.5
 type: category
diff --git a/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml b/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml
index 22433214..13a98673 100644
--- a/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml
+++ b/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml
@@ -1,4 +1,4 @@
 changefreq: weekly
-linkId: 9ca9c766-0fe7-406a-aa76-ef312b1cb6c3 # Services
+linkId: null
 priority: 0.5

This unfortunately will throw an error on running a migration:

- adding dolphiq_sitemap_entries.6d47467d-1bd2-4ea1-ae48-e17d430cce42 ...
error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'linkId' cannot be null
The SQL being executed was: INSERT INTO `craft_dolphiq_sitemap_entries` (`uid`, `linkId`, `type`, `priority`, `changefreq`, `dateCreated`, `dateUpdated`) VALUES ('6d47467d-1bd2-4ea1-ae48-e17d430cce42', NULL, 'category', 0.5, 'weekly', '2021-07-06 15:22:22', '2021-07-06 15:22:22')

I am able to rectify the issue by going into: admin/settings/sitemap and resaving the sitemap settings

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant