Skip to content

Commit

Permalink
Fix default list type not saving to project config when first install…
Browse files Browse the repository at this point in the history
…ing the plugin
  • Loading branch information
engram-design committed Mar 4, 2021
1 parent 2909ecf commit a85859c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
namespace verbb\wishlist\migrations;

use verbb\wishlist\Wishlist;
use verbb\wishlist\elements\ListElement;
use verbb\wishlist\elements\Item;
use verbb\wishlist\records\ListType;
use verbb\wishlist\models\ListType;

use Craft;
use craft\db\Migration;
Expand Down Expand Up @@ -128,8 +129,8 @@ public function insertDefaultData()
'itemFieldLayoutId' => $this->_itemFieldLayoutId,
];

$this->insert(ListType::tableName(), $data);
$listTypeId = $this->db->getLastInsertID(ListType::tableName());
$listType = new ListType($data);
Wishlist::$plugin->getListTypes()->saveListType($listType);
}
}

Expand Down

0 comments on commit a85859c

Please sign in to comment.