1

I’m having an issue with resaving a matrix block on users from a front end form. The problem is that after resaving the block and the page reloading. The styling on the page breaks until reload. When opening the web console, a number of errors are returned that I’m pretty sure shouldn’t be in the front end:

Imgur: web console errors

I think I may have found the code in the craftcms vendor files that is causing this to happen. It is located in craftcms/cms/src/elements/MatrixBlock.php

Commenting out the following code seems to stop all of the errors and on reload the page is fine:

/**
 * @inheritdoc
 */
public function afterDelete()
{

    if (!Craft::$app->getRequest()->getIsConsoleRequest()) {
        // Tell the browser to forget about this block
        $session = Craft::$app->getSession();
        $session->addAssetBundleFlash(MatrixAsset::class);
        $session->addJsFlash('Craft.MatrixInput.forgetCollapsedBlockId('.$this->id.');');
    }

    parent::afterDelete();
}

Apart from this, I can’t seem to get any further into cracking the issue. Does anyone have any ideas? Thanks.

closed as off-topic by Lindsey D Apr 25 '18 at 16:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Bug reports are off-topic because they are unlikely to help others and can’t easily be found by those who can fix them. Instead, submit them directly to the vendor, or the product’s public issue tracker (i.e. submit Craft CMS bug reports to https://github.com/craftcms/cms/issues)." – Lindsey D
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I have exactly the same problem. Using Matrix within SuperTable. – r-ninja Apr 19 '18 at 15:30
  • This should now be fixed thanks to this fix in 3.0.4 – Harry Harrison Apr 24 '18 at 20:28