doctrine-dbal icon indicating copy to clipboard operation
doctrine-dbal copied to clipboard

Release a version with PHP 8.2 support

Open hason-kosik opened this issue 2 years ago • 15 comments

Please, when will the new version with PHP 8.2 support be released?

hason-kosik avatar Jun 07 '23 13:06 hason-kosik

Hi @hason-kosik, max one week. I am finishing testing on my projects.

f3l1x avatar Jun 07 '23 22:06 f3l1x

@f3l1x Do you possibly have example how to replace EventSubscriber (e.g. like this one) with Middleware?

It used to register itself, thanks to these lines probably, now it does not...

haltuf avatar Jul 11 '23 17:07 haltuf

Hey @haltuf, thank you for pointing that.

I've implement EventManager support (again). Can you test it?

https://github.com/contributte/doctrine-dbal/commit/52b85b8fe5097a0ea90594ba48511c0e8d2abe03

f3l1x avatar Jul 11 '23 20:07 f3l1x

@f3l1x Thanks! It works now as before.

haltuf avatar Jul 11 '23 20:07 haltuf

@f3l1x Seems like schemaAssetsFilter changed its behaviour. Previously:

schemaAssetsFilter: PorovnavacZajezdu\Model\ORM\SchemaFilter::filter

with public static function filter(string|AbstractAsset $assetName): bool worked well.

Now it returns

Failed assertion #0 for item 'nettrine.dbal › configuration › schemaAssetsFilter' with value 'PorovnavacZa...

Is it a bug, or feature?

haltuf avatar Jul 12 '23 14:07 haltuf

It's a bug. Will repair.

Fixed here https://github.com/contributte/doctrine-dbal/commit/00c5783c57a8d3ac742d40171c4d2fd143de7fd3.

Please test it.

f3l1x avatar Jul 12 '23 19:07 f3l1x

Sorry, did not notice you have edited your last comment (no futher notification). I have tested it now and the problem has been solved by this commit.

haltuf avatar Jul 19 '23 08:07 haltuf

Good news. :-)

f3l1x avatar Jul 19 '23 12:07 f3l1x

Hi @f3l1x , I have trouble with sortable injected through this package.

Trying to call:

$rec = $this->em->getRepository(SuggestedTransformation::class);

Versions 0.9@dev dbal+orm, cache 0.4, annotations 0.8 leads to the error message:

This repository can be attached only to ORM sortable listener

with failure in here

This is how dump of $em->getEventManager()->getAllListeners() looks like:

obrazek

In versions 0.8 dbal+orm, cache 0.3, annotations 0.7 it works just fine.

This is how dump of $em->getEventManager()->getAllListeners() looks like in these:

obrazek

When updating from old (working) version to new (problematic) version, these are the packages that get updated:

Lock file operations: 0 installs, 4 updates, 0 removals
  - Upgrading nettrine/annotations (v0.7.0 => v0.8.1)
  - Upgrading nettrine/cache (v0.3.0 => v0.4.1)
  - Upgrading nettrine/dbal (v0.8.2 => dev-master 00c5783)
  - Upgrading nettrine/orm (v0.8.4 => dev-master 9e2cd91)

haltuf avatar Aug 15 '23 10:08 haltuf

@f3l1x Do you have idea, where I should be searching for the source of the problem? I can try to fix myself.

UPDATE: so the problem seems to be linked with dropping ContainerAwareEventManager and introducing ContainerEventManager with these lines creating anonymous class instead of class of a neccessary type.

UPDATE2: I have fixed the issue by replacing these lines with:

public function addServiceSubscriber(string|array $events, string $service): void
{
	$this->addEventListener($events, $this->container->getService($service));
}

I might have introduced some new problems, but this issue seems to be solved by this. The only behaviour that changed now, is that hash [email protected] changed to the result of spl_object_hash($listener);, but I think this should not cause any trouble.

haltuf avatar Aug 29 '23 10:08 haltuf

Thanks, I will take a look. addServiceSubscriber has special purpose to be lazy and not instance all subscribers at once.

f3l1x avatar Aug 30 '23 07:08 f3l1x

Can you please take a look @haltuf https://github.com/contributte/doctrine-dbal/commit/5053516ade579534de3fb3b401f316a1049644f5 and try latest version?

f3l1x avatar Aug 30 '23 11:08 f3l1x

Thanks @f3l1x , the problem seems to be fixed now.

haltuf avatar Aug 30 '23 12:08 haltuf

@f3l1x Not sure if my problem, or bug, I've noticed that Debug panel is empty when using this branch. I have:

nettrine.dbal:
  debug:
    panel: %debugMode%
    sourcePaths: [%appDir%/Model/ORM/Entity]

Yet Tracy says: obrazek

Will investigate further.

haltuf avatar Sep 12 '23 08:09 haltuf

Yes, it's empty. I must reimplement it, because there is no logger in DBAL anymore. I must use middlewares and custom classes.

f3l1x avatar Sep 12 '23 09:09 f3l1x