Support » Plugin: Gutenberg Blocks by Kadence Blocks – Page Builder Features » Row Divider – This block contains unexpected content

  • Hi.

    I notice that for all row blocks using the nice looking dividers, they work the first time I add them. When I edit the page, they give me the “This block contains unexpected content” error, and when I use the button “Try to repair this block”, it works in the editor. But when saving and viewing the front page, the deviders is no longer there.

    This is the same for ALL row blocks using those dividers.

    (My site is in a different language, so I am sorry if my error messages above is not exactly the same as in the English settings, but I guess you still understand what I mean) πŸ˜‰

Viewing 13 replies - 1 through 13 (of 13 total)
  • hannah

    (@hannahritner)

    Hey,
    Sorry to hear this! What version of Kadence Blocks are you running? Can you tell me what theme you’re using? Is this the only block you’re experiencing this with? Are you able to post a link?

    Thanks,
    Hannah

    Thread Starter Gomle

    (@gomle)

    I have narrowed down the issue to this, using a fresh install of WordPress Multisite with no plugins installed except Kadence Blocks and Duplicate Page:

    I am using WP Multisite.
    I use Duplicate Page plugin to duplicate the page I’ve made.

    If the Network Admin adds any page-dividers to the clients pages and save, it works.

    If the client himself log into his sub-site, and does changes to the page that contains the page dividers, and then saves the page – the page dividers are gone on the front-end, but visible in the editor.

    So either there is something I don’t understand regards to Kadence + WPMU, or I don’t have the license (I’m still just using the free theme + free kadence blocks).Β – OR there is something wrong with the page dividers when used on a subsite on the wordpress multisite networks.

    So to sum it if you want to replicate the issue on your side (IF there is an error and not only a lisence-problem):

    THIS WORK: As network admin either on the main site, or logged into a client’s sub-site.

    THIS DOES NOT WORK: When the client logs in to his own subdomain.mydomain.com and tries to use the page dividers.

    Thread Starter Gomle

    (@gomle)

    I am using Kadence Free theme and Kadence Blocks – both latest versions.

    Hey,
    Muiltisites use filtered html which will filter out svgs. It’s a known issue with WordPress and there are 8 year old tickets to fix but no one on the core team has done anything as of yet.

    So my suggestion is to disable HTML filtering using: https://wordpress.org/plugins/unfiltered-mu/

    Ben

    Thread Starter Gomle

    (@gomle)

    Wow, thank you for the fast reply!
    And thank you for that link.

    However, I see that plugin is very old, and also very dangerous.
    Is there no other way to get shape dividers or SVG’s to work?

    Hey

    “I see that plugin is very old” – It’s a very simple plugin with no reason to update because it is very simple. But you can rest assured it works just fine.

    “and also very dangerous” – That is misleading. Filtering HTML is useful if you have users at the author level that you don’t trust on your site, but given that this is to allow a site admin to work in their own site I do not think this qualifies as “very dangerous” on non-multisite admins and editors don’t normally have HTML filtering.

    If you want inline svgs you need to disable the HTML filter. So there are other ways to disable but the plugin I linked to is the easiest.

    Ben

    Thread Starter Gomle

    (@gomle)

    Ok. Thank you.
    I tried the plugin, and it does exactly as you say. The SVG shape dividers works beautifully.

    The dangerous-part: I may have misunderstood the warnings. But to me it sounds like a siteadmin at subdomain1 can use JS to access subdomain2 etc.

    If that is impossible, and the network itself is not at risk, I am not worried.

    If you have users in your multisite with an author level or above permissions that you do not trust then you should not use this plugin. That is usually not the case but if it is for you then I don’t suggest you use it. But I would go a step further and say you probably want to separate out those sites in general because adding HTML through the editor is not the only way an site admin could hack another site in the network.

    Either way if you want users to be able to post full HTML (which includes svg) then you have to accept that they could post any unfiltered HTML. WordPress doesn’t have proper filters to allow just inline svgs because svgs can contain x1 and y1 attributes.

    Ben

    Thread Starter Gomle

    (@gomle)

    Well, I don’t know any of my users. All I know is that they are people that are willing to pay me to get their own small website up and running in a very spesific niche.
    All sites are created as subdomains.mydomain.com using the wpultimo plugin, and they are all admins of their own site.

    • This reply was modified 1 year, 1 month ago by Gomle.

    ok, yeah that would be a security risk. You would need to go about this differently if you have unknown users with admin permissions. You need to run a custom plugin where you add something like this:

    /**
     * Allows for svg attributes in filtered html.
     *
     * @param array  $tags the supported html.
     * @param string $context the context of save.
     */
    function custom_allow_svg_icons_html( $tags, $context = null ) {
    	if ( isset( $context ) && 'post' === $context ) {
    		$tags['svg'] = array(
    			'fill'            => true,
    			'focusable'       => true,
    			'class'           => true,
    			'aria-hidden'     => true,
    			'aria-labelledby' => true,
    			'role'            => true,
    			'xmlns'           => true,
    			'width'           => true,
    			'height'          => true,
    			'viewbox'         => true,
    			'stroke'          => true,
    			'stroke-width'    => true,
    			'stroke-linecap'  => true,
    			'stroke-linejoin' => true,
    			'style'           => true,
    		);
    		$tags['path'] = array(
    			'd'    => true,
    			'fill' => true,
    		);
    		$tags['circle'] = array(
    			'cx' => true,
    			'cy' => true,
    			'r'  => true,
    		);
    		$tags['rect'] = array(
    			'x'      => true,
    			'y'      => true,
    			'width'  => true,
    			'height' => true,
    			'rx'     => true,
    			'ry'     => true,
    		);
    		$tags['line'] = array(
    			'class'             => true,
    			'stroke'            => true,
    			'stroke-linecap'    => true,
    			'x1'                => true,
    			'y1'                => true,
    			'x2'                => true,
    			'y2'                => true,
    			'data-temp-xa-hash' => true,
    			'data-temp-ya-hash' => true,
    			'data-temp-xb-hash' => true,
    			'data-temp-yb-hash' => true,
    		);
    		$tags['polygon'] = array(
    			'points' => true,
    			'fill'   => true,
    		);
    		$tags['polyline'] = array(
    			'points' => true,
    			'fill'   => true,
    		);
    		$tags['title'] = array(
    			'title' => true,
    		);
    		$tags['g'] = array(
    			'fill' => true,
    		);
    	}
    	return $tags;
    }
    add_filter( 'wp_kses_allowed_html', 'custom_allow_svg_icons_html', 20, 2 );

    That should work in most cases but it won’t work in all because of the limitations of this filter in core.

    Thread Starter Gomle

    (@gomle)

    Ok, that was very nice to know up front πŸ™‚

    I tried the code using Code Snippets, but unfortunately that did not work to show the Kadence Block Shape dividers inside the Row block on my new client page.

    Maybe I will have to do it without those dividers then πŸ™

    Thread Starter Gomle

    (@gomle)

    Hmm. Actually it almost did work
    https://prnt.sc/194h3rn

    If you look closely, the dividers are actually there, but the colors and width etc. is not correct.

    hannah

    (@hannahritner)

    Hi @gomle,
    Apologies for the delay! Are you able to post a link?

    Kindly,
    Hannah

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Row Divider – This block contains unexpected content’ is closed to new replies.