-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Allow for installation on Symfony 4.4 #17380
Conversation
(Standard links)
|
Jenkins is happy! :-) |
@seamuslee001 Quick question - Do we need to continue supporting 2.8? |
I'd vote to drop 2.8 at this point if we can. It's pretty long in the tooth now and I don't see where we'd "need" it for anything backwards compatibility wise. |
I've removed 2.8.50 now and the standard install will be Symfony 3.4.x now lets see what Jenkins thinks of it |
I have removed WIP as Jenkins seems to be ok with this PR I have submitted a PR for flexmailer civicrm/org.civicrm.flexmailer#57 that would need to be merged with this PR as going to v3.4 will break things in flexmailer |
I'm also +1 for removing 2.8 on general simplification grounds. IMHO, the initial/main reason for keeping 2.8 was general backwards-compatibility/risk-aversion on traditional build types (D7/WP/J). But now that we've had people using Symfony 3.x on D8 builds, that risk is mitigated. As a general rule, I don't think any published build processes require Symfony 2.x compat. Another smaller, historical consideration was that Note: Off the cuff, I would expect Part of me thinks that maybe |
@totten apart from the fact services are private by default going forward the removal of the container aware dispatcher i think is the only other significant thing which is a thing Flexmailer ran into (not sure if Mosaico worries either) |
This function was previously provided by inheriting from ContainerAwareEventDispatcher, but that class isn't available in Symfony 4.4. This is a work-a-like implementation.
@@ -15,7 +15,7 @@ | |||
* | |||
* @see \CRM_Utils_Hook | |||
*/ | |||
class CiviEventDispatcher extends ContainerAwareEventDispatcher { | |||
class CiviEventDispatcher extends EventDispatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah, this is a BC break that removes some functions - eg getContainer()
, addListenerService()
, addSubscriberService()
.
Personally, losing getContainer()
is fine. (If someone really needed a container reference, they'd be more likely to use Civi::container()
than Civi::disptacher()->getContainer()
...) But losing addListenerService()
feels a bit more dephell-y. Both flexmailer+mosaico use addListenerService()
.
I suspect that anyone on D7/WP/J + Mosaico would be looking at WSOD under normal upgrade procedures:
- If you upgrade
civicrm-core
first, then you'd get WSOD (i.e. becauseaddListenerService()
is used by the older/pre-upgrade ext) - so you don't get a chance to update flexmailer+mosaico. - If you upgrade flexmailer+mosaico first, then you'd get WSOD (i.e. because
ServiceClosureArgument
isn't a thing in Symfony 2.8) before you can update civicrm-core.
Perhaps we can just re-create addListenerService()
directly in CiviEventDispatcher
(since we can't inherit it)? Then it doesn't matter how you mix/match the versions - b/c civicrm-core
supports the same contract either way.
I've pushed up a commit which does that. flexmailer
(both current master
and latest v1.1.1
) passes its unit-tests run with this.
(In principle, re-creating addSubscriberService()
would make sense too... but I don't think anyone in universe
uses it. The code in \Civi\FlexMailer\Services::registerListeners()
doesn't matter because that function never runs, and it hasn't since v0.1.-alpha1...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh that is ok by me @totten
just added the needs documentation flag so we can make sure to remember to update dev docs |
Flagged as mergeable - I think the main BC break is mitigated, and no one seemed to think of any other problems. The specific dev-doc that needs updating is here: https://docs.civicrm.org/dev/en/latest/hooks/usage/symfony/#methods |
jenkins, test this please |
Has a docs PR civicrm/civicrm-dev-docs/pull/810 which is approved (by me at least!) for merge with the core release. |
I'm going to merge this now given no obvious objections coming through |
Thank you @seamuslee001 👍 |
Overview
Work in progress PR for running CiviCRM using Symfony 4.4 as is required by Drupal 9
Before
Symfony 2.8.x and 3.x are used
After
Symfony 3.x and 4.4.x are used
Technical Details
Main things are as of Symfony 3.3 all services are private by default, also the ContainerAwareEventDisapatcher is removed in 4.0 and so there is a bit of tape to support the various versions
ping @totten @MikeyMJCO @KarinG