wp-graphql-content-blocks icon indicating copy to clipboard operation
wp-graphql-content-blocks copied to clipboard

CoreTable column alignment returns null

Open brysonchiu opened this issue 9 months ago • 1 comments

The core table block is returning null values for cell alignment even when it is set. The cell alignment is instead set by the whole table alignment. This seems like a mistake.

Steps to reproduce

  1. Add a core table into a page and adjust the alignment on a column (not the alignment of the table).
  2. Add this into your page query:
    editorBlocks {
      ... on CoreTable {
        attributes {
          body {
            cells {
              align
            }
          }
          foot {
            cells {
              align
            }
          }
          head {
            cells {
              align
            }
          }
        }
      }
    }

brysonchiu avatar May 09 '24 14:05 brysonchiu

Can also add to this that we are seeing all of our CoreTable cell values return null. Most concerning, content returns null even though I can confirm we have content in all of our test body cells.

"body": [
              {
                "cells": [
                  {
                    "align": null,
                    "colspan": null,
                    "content": null,
                    "rowspan": null,
                    "scope": null
                  },
                  {
                    "align": null,
                    "colspan": null,
                    "content": null,
                    "rowspan": null,
                    "scope": null
                  }
                ]
              },

phillubliner avatar May 16 '24 15:05 phillubliner

Hey @phillubliner and @brysonchiu I've reproduced this issue and I will provide a fix soon.

theodesp avatar Jun 13 '24 13:06 theodesp

@phillubliner @brysonchiu

https://github.com/wpengine/wp-graphql-content-blocks/releases/tag/v4.0.1

Should contain a fix for this issue. I'm closing this ticket but feel free to comment back if you still have any problems.

theodesp avatar Jun 25 '24 15:06 theodesp

content is still null

marcinwenger avatar Jul 23 '24 18:07 marcinwenger

Hello @theodesp, I can confirm the same: content still returns null. Is there any news on this? Thanks!

MajesticPagan avatar Aug 06 '24 17:08 MajesticPagan

I think the content problem is here: https://github.com/wpengine/wp-graphql-content-blocks/blob/7c3a6d7e2b0825f9e3cdd9e6411152d4957bb114/includes/Blocks/Block.php#L139

The content of the table cells is in the format <TD>TheContent</TD>and must be parsed as html but the source is rich-text. If i change to case 'rich-text': $result[$key] = $this->parse_single_source($html, 'html'); break;

The cells are populated but I'am not deep enough in the topic to understand if this will course strange functions in other attributes.

lekkacat avatar Aug 14 '24 06:08 lekkacat

@theodesp

I have just updated to the latest WP, 6.6.1, and the latest wp-graphql-content-blocks, 4.1.0, and the cell alignment is still returning null. Im updating from WP 6.4.5 and wp-graphql-content-blocks 3.1.2.

Additionally, like others have stated, the content is too returning null. This is a new issue for me since updating.

Should I open a new issue or continue with this thread?

brysonchiu avatar Sep 03 '24 19:09 brysonchiu