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

Why custom delegates? #47

Closed
michael-e opened this issue Jan 27, 2016 · 9 comments
Closed

Why custom delegates? #47

michael-e opened this issue Jan 27, 2016 · 9 comments

Comments

@michael-e
Copy link
Member

Forgive me if this question is stupid or has been asked before — I have never used the reflection field actively, so I have not followed all discussions.

I was wondering why the XMl Importer has custom delegates XMLImporterEntryPostCreate and XMLImporterEntryPostEdit. The custom delegates must be called by other extensions, e.g. the Reflection Field.

Why not use Symphony's delegates EntryPostCreate and EntryPostEdit instead? Is there any special reason for this?

@nitriques
Copy link
Member

I seriously to do know why. I do not think it's bad since one may wants to do special things only when importing data... But the "core" delegates should be fired too, IMHO.

@nitriques
Copy link
Member

I would ping @andrewminton since he's the one who submitted #25

@andrewminton
Copy link
Contributor

My commit was to be able to handle post event creation triggers.. i.e. send an email to myself once an import had completed.. reporting how many imports were successful/had errors. If this could be done with the core alone.. then there is no need for them. It was a proof of concept without enough in depth knowledge of the core so ignore/revert/do as you please I have no issue with that commit being rejected.

@nitriques
Copy link
Member

So they have a valid reason to exist... but I think we should call the core one as well. Thanks Andrew!

@andrewminton
Copy link
Contributor

No worries. I'm not as knowledgable about the core so felt like introducing a delegate in the importer was right and was fit for purpose. But I guess the reflection field case is a little different. If post creation you then need to trigger an edit of that created field to reflect the value... is the core better suited at handling that.. rather than introducing a new deldegate... is that what you mean @michael-e ?

@nitriques
Copy link
Member

Introducing a new delegate was the right thing to do: You would not want to send an email on each and every EntryPostEdit ... But not calling the core one is a missing feature IMHO.

@michael-e
Copy link
Member Author

Agreed. Will create a new issue for the missing core delegates.

@nitriques
Copy link
Member

Thanks Micheal

@michael-e
Copy link
Member Author

I noticed that the delegates I was talking about were not the ones introduced by @andrewminton. I was talking about XMLImporterEntryPostCreate and XMLImporterEntryPostEdit; those are much older, I think. I will add a short comment to #48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants