Przeglądaj źródła

Fix commenting not working on pages with read_only FieldPanels

Fixes #11838
Strapchay 4 miesięcy temu
rodzic
commit
b3ba89b2ec

+ 1 - 0
CHANGELOG.txt

@@ -24,6 +24,7 @@ Changelog
  * Fix: Ensure Cloudfront cache invalidation is called with a list, for compatibility with current botocore versions (Jake Howard)
  * Fix: Show the correct privacy status in the sidebar when creating a new page (Joel William)
  * Fix: Prevent generic model edit view from unquoting non-integer primary keys multiple times (Matt Westcott)
+ * Fix: Ensure comments are functional when editing Page models with `read_only` `Fieldpanel`s in use (Strapchay)
  * Docs: Move the model reference page from reference/pages to the references section as it covers all Wagtail core models (Srishti Jaiswal)
  * Docs: Move the panels reference page from references/pages to the references section as panels are available for any model editing, merge panels API into this page (Srishti Jaiswal)
  * Docs: Move the tags documentation to standalone advanced topic, instead of being inside the reference/pages section (Srishti Jaiswal)

+ 1 - 0
CONTRIBUTORS.md

@@ -856,6 +856,7 @@
 * Steven Steinwand
 * Clifford Gama
 * Noah van der Meer
+* Strapchay
 
 ## Translators
 

+ 1 - 1
client/src/entrypoints/admin/comments.js

@@ -19,7 +19,7 @@ window.comments = (() => {
 
   function getContentPath(fieldNode) {
     // Return the total contentpath for an element as a string, in the form field.streamfield_uid.block...
-    if (fieldNode.closest('[data-contentpath-disabled]')) {
+    if (!fieldNode || fieldNode.closest('[data-contentpath-disabled]')) {
       return '';
     }
     let element = fieldNode.closest('[data-contentpath]');

+ 1 - 0
docs/releases/6.4.md

@@ -37,6 +37,7 @@ depth: 1
  * Ensure Cloudfront cache invalidation is called with a list, for compatibility with current botocore versions (Jake Howard)
  * Show the correct privacy status in the sidebar when creating a new page (Joel William)
  * Prevent generic model edit view from unquoting non-integer primary keys multiple times (Matt Westcott)
+ * Ensure comments are functional when editing Page models with `read_only` `Fieldpanel`s in use (Strapchay)
 
 ### Documentation