Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release a version with PHP 8.2 support #80

Closed
hason-kosik opened this issue Jun 7, 2023 · 16 comments
Closed

Release a version with PHP 8.2 support #80

hason-kosik opened this issue Jun 7, 2023 · 16 comments

Comments

@hason-kosik
Copy link

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

@f3l1x
Copy link
Member

f3l1x commented Jun 7, 2023

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

@haltuf
Copy link

haltuf commented Jul 11, 2023

@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...

@f3l1x
Copy link
Member

f3l1x commented Jul 11, 2023

Hey @haltuf, thank you for pointing that.

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

52b85b8

@haltuf
Copy link

haltuf commented Jul 11, 2023

@f3l1x Thanks! It works now as before.

@haltuf
Copy link

haltuf commented Jul 12, 2023

@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?

@f3l1x
Copy link
Member

f3l1x commented Jul 12, 2023

It's a bug. Will repair.

Fixed here 00c5783.

Please test it.

@haltuf
Copy link

haltuf commented Jul 19, 2023

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.

@f3l1x
Copy link
Member

f3l1x commented Jul 19, 2023

Good news. :-)

@haltuf
Copy link

haltuf commented Aug 15, 2023

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
Copy link

haltuf commented Aug 29, 2023

@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 service@nettrine.extensions.attlantic18.sortable changed to the result of spl_object_hash($listener);, but I think this should not cause any trouble.

@f3l1x
Copy link
Member

f3l1x commented Aug 30, 2023

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

@f3l1x
Copy link
Member

f3l1x commented Aug 30, 2023

Can you please take a look @haltuf 5053516 and try latest version?

@haltuf
Copy link

haltuf commented Aug 30, 2023

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

@haltuf
Copy link

haltuf commented Sep 12, 2023

@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.

@f3l1x
Copy link
Member

f3l1x commented Sep 12, 2023

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

@f3l1x
Copy link
Member

f3l1x commented Dec 5, 2024

Version 0.9.x is bumped. I work on 0.10.x with DBAL 4.2+ requirements and multi connection support. Closing here.

9996070

@f3l1x f3l1x closed this as completed Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants