This might not be the answer you were looking for, but I don't think you need to go to great lengths trying to achieve something that in my opinion is not necessary. While it might seem to be not "clean" to have database table columns that are not required by your application/plugin, consider that todays ICT infrastructure is powerful enough to not ...


For future reference of anybody stumbling onto this post (like me), setting ->typeId works for like 90%, but to cover it all put this in it too: $entry->fieldLayoutId = null; If you don't throw the field layout out, it might still hold on to the old fields of the entry. This gives some really weird issues, like a relational field being filled in the ...


Try this: Craft::$app->getUrlManager()->setRouteParams([ 'variables' => ['order' => $order] ]);

Only top voted, non community-wiki answers of a minimum length are eligible