Support » Plugin: Block Lab » This block has encountered an error and cannot be previewed

  • Resolved Svensson36

    (@svensson36)


    Hi,

    I really like your plugin but now I have a big problem. When I try to edit a block in the editor and click in the block, there comes an error message saying “This block has encountered an error and cannot be previewed” (In diesem Block ist ein Fehler aufgetreten und eine Vorschau ist nicht möglich). It is not possible to edit anything in this block.
    I have the impression that this has something to do with images because blocks without images are working correctly.

    This is the code of the wrong block:

    <div class="wp-block-cover alignfull bilderblock-vier" style="background:<?php block_field( 'hintergrundfarbe' ); ?>;"><!-- cover-block -->
    <div class="bilderblock-wrapper"><!-- .bilderblock-wrapper -->
        <div><figure class="aligncenter"><img src="<?php block_field( 'bild-1' ); ?>" alt="" /><figcaption><em><?php block_field( 'bu-bild-1' ); ?></em></figcaption></figure></div>
    		<div><figure class="aligncenter"><img src="<?php block_field( 'bild-2' ); ?>" alt="" /><figcaption><em><?php block_field( 'bu-bild-2' ); ?></em></figcaption></figure></div>
    		<div><figure class="aligncenter"><img src="<?php block_field( 'bild-3' ); ?>" alt="" /><figcaption><em><?php block_field( 'bu-bild-3' ); ?></em></figcaption></figure></div>
    		<div><figure class="aligncenter"><img src="<?php block_field( 'bild-4' ); ?>" alt="" /><figcaption><em><?php block_field( 'bu-bild-4' ); ?></em></figcaption></figure></div>
    	</div><!-- /.bilderblock-wrapper -->
    </div><!-- /cover-block -->

    Do you have an idea what might have caused this error?

    Thank you in advance!

    • This topic was modified 10 months ago by Svensson36.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Luke Carbis

    (@lukecarbis)

    @svensson36 That code looks right to me. I got the block working in my development environment without any problems.

    What values to you have assigned to the images?

    Does the block load on the frontend?

    Take a look at my screen recording, and see if there’s anything different in my setup compared to yours.

    Thank you for your help. My setup is exactly the same, so I really don’T know what happened. Yes, the block loads on the frontend, but it is not possible to change anything.
    Because I had to change something for a customer I solved it so far by creating a new block, where the image is put into the block with the URL of the image. It’s not so elegant, but for the moment ist works.
    But if you have any idea what might have caused this issue I would be very thankful.

    Plugin Author Luke Carbis

    (@lukecarbis)

    @svensson36 I’m really not sure what could have caused the error. In our next release we’re reworking the output of the image block, so I’d suggest trying again and maybe it will work better after the next update!

    Thank you!
    My solution works so far and I will try again the next release.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘This block has encountered an error and cannot be previewed’ is closed to new replies.