You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not so much an issue, but maybe a general discussion on the best approach? The short of the issue is that in Feed Me, when updating an element that has a Matrix field, which in turn has element fields, there's an error being thrown:
session_start(): Cannot send session cookie - headers already sent by (output started at /vendor/yiisoft/yii2/web/Response.php:414) - Session.php:137
This is only when triggering a task through the queue. Running it directly (with a logged in session) works just fine.
After much trial an error, I've isolated it to the following code in elements/MatrixBlock.php:
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();
}
And I can see why this would happen, and why its throwing the error. So rather than suggest modifying this function (even with a try-catch), is there some may to masquerade requests as if they were console commands? Or would there be a better approach for this?
Apologies if this is not the right platform for discussion.
The text was updated successfully, but these errors were encountered:
Not so much an issue, but maybe a general discussion on the best approach? The short of the issue is that in Feed Me, when updating an element that has a Matrix field, which in turn has element fields, there's an error being thrown:
This is only when triggering a task through the queue. Running it directly (with a logged in session) works just fine.
After much trial an error, I've isolated it to the following code in
elements/MatrixBlock.php
:And I can see why this would happen, and why its throwing the error. So rather than suggest modifying this function (even with a try-catch), is there some may to masquerade requests as if they were console commands? Or would there be a better approach for this?
Apologies if this is not the right platform for discussion.
The text was updated successfully, but these errors were encountered: