Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Truncated Html Column in Attribute Matrix can break Page Layouts

Open tcavaletto opened this issue 3 years ago • 2 comments

Submitted on behalf of Fellowship Bible Church

Prerequisites

  • [x] Put an X between the brackets on this line if you have done all of the following:
    • Did you perform a search at https://github.com/issues?q=is%3Aissue+user%3ASparkDevNetwork+-repo%3ARock to see if your bug or enhancement is already reported?
    • Can you reproduce the problem on a fresh install or the demo site?
    • Did you include your Rock version number and client culture setting?

A Picture Is worth a Thousand Words

image image

Description

When you go to edit mode on an entity with an attribute matrix, the matrix loads as a series of rows that a user can click on to edit the matrix item. When one of the columns is html with layout code ( divs / tables), that column is truncated off, which excludes any closing tags the html has. This breaks any layouts on the page.

I can think of two solutions:

  1. Display the full value if the field type is HTML
  2. scrub HTML tags from the value being displayed in the row

Steps to Reproduce

  1. Add an attribute matrix with an html field
  2. Add a matrix attribute set to that template onto an entity ( content channel item, group)
  3. Go to one of the entities and populate a matrix item with html that includes 'layout' tags (divs, tables)
  4. Save the Matrix Item
  5. See Error

Expected behavior:

The value should be truncated and handled in a way that doesn't break surrounding layouts

Actual behavior:

The closing html tags are truncated, breaking the page layout

Versions

  • Rock Version: [Enter Rock version here]
  • Client Culture Setting: [Enter Client Culture here]

tcavaletto avatar Oct 06 '21 14:10 tcavaletto

@tcavaletto, any chance you could specify the Rock Version and share the HTML that was used to produce the bug?

cwomack avatar Oct 11 '21 17:10 cwomack

@cwomack The Rock Version is 12.4.

Here's the HTML:

<table class="table"><tbody><tr><td><b>Sept 5</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">Genesis 12:1-19</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;"><b>Call of Abraham</b></span></i></div></i></td></tr><tr><td><b>Sept 6
</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">2 Timothy 2:1-13</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;">Entrust to others</span></i></div></i></td></tr><tr><td><b>Sept 7
</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">Titus 2:1-15</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;">Teach sound doctrine</span></i></div></i></td></tr><tr><td><b>Sept 8
</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">Acts 1:1-11</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;">Promise of the Holy Spirit</span></i></div></i></td></tr><tr><td style="text-align: left;"><b>Sept 9
</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">John 15:18-16:4</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;">Spirit of Truth</span></i></div></i></td></tr><tr><td><b>Sept 10</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">Matthew 5:13-16</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;">Salt and Light</span></i></div></i></td></tr><tr><td><b>Sept 11</b></td><td><div style="text-align: right;"><span style="background-color: transparent;">Ephesians 4:14-21</span></div><i><div style="text-align: right;"><i style="background-color: transparent;"><span style="font-size: 12px;">Paul's prayer for Christ followers</span></i></div></i></td></tr></tbody></table>

JoshuaMaiorino avatar Oct 14 '21 12:10 JoshuaMaiorino

@tcavaletto can you confirm this is still an issue on v16. Below is an example on a Content Channel Item edit screen with the HTML from above.

image

jonedmiston avatar Sep 26 '23 06:09 jonedmiston

Closing due to no response. Feel free to re-open if you think this is still an issue.

jonedmiston avatar Oct 05 '23 20:10 jonedmiston