Skip to content

Commit

Permalink
Fix reoccurring discriminator map issue (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mesuva committed Oct 13, 2024
1 parent 15632c1 commit c300684
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Concrete\Package\CommunityStore;

use Concrete\Core\Entity\Attribute\Key\Key;
use Concrete\Core\Http\Request;
use Concrete\Core\Asset\Asset;
use Concrete\Core\Asset\AssetList;
Expand All @@ -26,7 +27,7 @@ class Controller extends Package implements ProviderAggregateInterface
{
protected $pkgHandle = 'community_store';
protected $appVersionRequired = '8.5';
protected $pkgVersion = '2.7.2-alpha1';
protected $pkgVersion = '2.7.2-alpha2';

protected $npmPackages = [
'sysend' => '1.3.4',
Expand Down Expand Up @@ -180,6 +181,13 @@ public function registerHelpers()

public function on_start()
{
$entityManager = $this->app->make(EntityManagerInterface::class);
$metaData = $entityManager->getMetadataFactory()->getMetadataFor(Key::class);
foreach (Installer::KEY_CATEGORIES as $name => $className) {
$metaData->addDiscriminatorMapClass($name, $className);
}
$entityManager->getMetadataFactory()->setMetadataFor(Key::class, $metaData);

$this->registerAutoload();
$this->registerHelpers();
$this->registerRoutes();
Expand Down
1 change: 1 addition & 0 deletions src/CommunityStore/Utilities/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function install(Package $package, array $installerOptions = []): void

public function upgrade($package)
{
$this->addNewCategoriesToDiscriminatorMap();
$this->createBlockTypes($package);
$this->createSinglePages($package, true);
$this->createUserAttributes($package);
Expand Down
8 changes: 8 additions & 0 deletions src/Concrete/Repository/StoreProductKeyRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
namespace Concrete\Package\CommunityStore\Repository;

use Doctrine\ORM\EntityRepository;

class StoreProductKeyRepository extends EntityRepository
{}

0 comments on commit c300684

Please sign in to comment.