Repository navigation
[dev/joomla#70] Remove legacy Joomla 3 compatible code - #38297
webmaster-cses-org-uk wants to merge 2 commits into
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
PR commands & links...
|
|
@seamuslee001 @vingle FYI |
civireview
left a comment
There was a problem hiding this comment.
CiviReview: 🟢 Ready · 5/5 ★★★★★
Removes all Joomla 3 and earlier compatibility branches (version_compare/JVERSION, JFactory, jimport) from core Joomla code, authx and setup, leaving only the Joomla 4+ code paths. The PR says it must not merge before 6.23.
No findings above the confidence gate.
✅ CI · ✅ Base tests · ✅ Surface · ✅ Taint · ✅ Browser
Verification (5 checks, 1 not verified)
Merge confidence (5/5): No verified issues; passed CI / Jenkins, Base-Test Regression, Live Surface Diff.
PR: civicrm/civicrm-core#38297 · Profile: core-extension · Kind: security-sensitive · Commits: 4fc75cc → 8c5342c
| Check | Status | Detail |
|---|---|---|
| CI / Jenkins | ✅ PASS | 1 CI checks: 1 passed, 0 failed, 0 pending. |
| Base-Test Regression | ✅ PASS | PR merged into 4fc75cc: 27 test(s) passed on A and B |
| Live Surface Diff | ✅ PASS | Live APIv4/APIv3/routes/Afform surface diff captured with 0 risk flags. |
| Static / Taint Delta | ✅ PASS | Executed [cktaint] with 0 finding(s). |
| Browser A/B (Standalone) | ✅ PASS | Probed 1 route(s), 1 screenshot pair(s); 0 new console/page/network/a11y/render regressions. |
Not verified:
- No added/modified PHPUnit tests in PR; Proof-of-Fix A/B test skipped.
Standalone browser A/B
- Probed routes (1):
civicrm/payment/ipn - New console errors: 0 · Page errors: 0 · Network failures: 0 · A11y violations: 0 · Render regressions: 0
- Screenshots: 1 before/after pair(s) captured
More: Walkthrough · blast radius · related (1)
Walkthrough
- CONFIRMED: The PR changes five files: Permission/Joomla, Hook/Joomla, System/Joomla, authx/Joomla and InstallJoomlaSettingsFile. Every
version_compare(JVERSION, ...)branch now uses only the J4+ API (\Joomla\CMS\Factory,UserHelper,Table\User,Uri,Filesystem\File). At head, greps ofCRM/,ext/andsetup/find noJFactory,JUserHelper,jimport,JTable,JURIorJFile. The only remainingJVERSIONuses are inCRM_Utils_System_Joomla::url()andgetJVersion(). - CONFIRMED: The public method
CRM_Utils_System_Joomla::factoryClassName()is removed. Its callers were all insideCRM/Utils/System/Joomla.phpand are now inlined. An index-wide search outside that file (civicrm_grep factoryClassName\() found 0 callers in any indexed extension. A release-note mention would still help unindexed third-party code that calls it. - CONFIRMED (auth paths):
authenticate()and authxcheckPassword()now always call\Joomla\CMS\User\UserHelper::verifyPassword. The dropped md5/salt check only ran on Joomla below 2.5.18 or 3.0–3.2.1.loginSession,logoutSessionandgetCurrentUserIdkeep the same J4 logic they had before. The removed authx constructor only calledjimporton J<4. - CONFIRMED (harmless leftovers, not defects): in
url()(lines 308-317), the$forceBackendbranch still computes$joomlaVersion, which is now unused. The/administrator/rewrite is now unconditional, which matches the old behaviour on J>=1.6.loadJoomlaFramework()(lines 991-997) still has the J3-eraimport.legacy.php/cms.phpfallbacks, which are unreachable on J4+. IngetJVersion(), changingrequiretorequire_onceis strictly safer against redeclaring the class. - PROVEN (limited): In the A/B run, 27 tests passed on both stacks with no regressions, including
CRM_Core_Permission_JoomlaTest::testTranslate. The standalone browser probe showed no new errors. The image is standalone, so neither check runs Joomla code. - NOT VERIFIED: The standalone stacks cannot run any Joomla code: login/
authenticate,createUser, user sync, the CLI/cron bootstrap, the hook plugin trigger and the installerFile::write. The author reports only a brief test on Joomla 5.4.11. The PR body says this must not merge before 6.23 (Feb 2027). That gate depends on milestone/process and cannot be checked in the code.
Ecosystem blast radius
| Repo | Path | Symbol | Impact |
|---|---|---|---|
| civicrm-core | CRM/Utils/System/Joomla.php |
CRM_Utils_System_Joomla::factoryClassName |
The public method is removed. No callers were found in indexed repos, but unindexed third-party code that calls it would fatal. |
| civicrm-core | ext/authx/Civi/Authx/Joomla.php |
Civi\Authx\Joomla |
Password and session handling are now J4+ only. Behaviour on J4+ is unchanged. |
| civicrm-core | CRM/Utils/Hook/Joomla.php |
CRM_Utils_Hook_Joomla::invokeViaUF |
Hooks are now always triggered via PluginHelper and Factory::getApplication(). This was already the J4+ path. |
| civicrm-core | setup/plugins/installFiles/InstallJoomlaSettingsFile.civi-setup.php |
installFiles |
The installer now uses only Uri::root() and \Joomla\Filesystem\File::write. |
Related open PRs and issues
| Item | Relation | Confidence | Why |
|---|---|---|---|
| dev/joomla#61 — Joomla 6 Compatibility | 🔗 related |
60% | It covers Joomla 6 compatibility work in the same Joomla system and authx code that this PR simplifies to J4+ APIs. |
Automated AI-assisted review, alpha: it may miss issues or report false positives, so verify findings before acting and open an issue with feedback. Reviewed by civireview · sonnet-opus · 1,049,607 tokens · $0.68
|
I feel like civi-review missed a trick here with it's glowing review... Do not merge before CiviCRM 6.23 (Feb 2027) as this removes J3 support. |
|
@colemanw @eileenmcnaughton The AI review did however pick up on the following, which I have now also resolved:
There was also a J1.5-era path ( |
@jfilter - it looks like CiviReview is doing two distinct things: reviewing the output for errors and omissions, and giving a confidence rating about how valid it is to merge. The former seems evidently useful, the latter quite a bit riskier, given all we now know about algorithmic bias (humans consistently trust machine-output more than human, even when they know the machine output may be flawed). It seems there's a few contexts where a review of the code might miss either key information in the description like here, or visual bugs that are only apparent when the output is rendered by a browser, or specific CMS (or in the case of another 5 star review of a breaking PR, specific viewport). Presumably descriptions that say this PR does ABC, where the output does BCD perfectly might also be hard to spot. Do you think the rating side of the review could be made less prominent/confident? or set to a much higher threshold so the default good review is lower? Or to be a little more scientific - hold off publishing ratings, keeping a confidence score private/separate until the tool's accuracy itself has been verified over a a few weeks/months of PRs and feed that back into the rating system. That way there could be some kind of threshold where 5 star might mean a level where 99 in 100 reviews need no further work, and 4 star 90 in 100 etc. |
|
But @webmaster-cses-org-uk - this (and the other PRs) are really great to see! |
I also missed that. Where is our Joomla timeline documented? |
|
CiviReview is very far from being perfect, and this PR shows some of its limitations. But I still think it's better than the way I and others have done AI reviews before. Before, people just said "review this PR" to a model and hoped it would dig something up. This is more reproducible. The score, for example, is calculated by this simple algorithm: https://github.com/civico-de/civireview/blob/main/docs/reading-a-review.md#merge-confidence (which of course relies on the model for the findings).
It is written in the summary, but I agree it's easy to miss. I will add some new features, e.g. a check for those "requirements before merge", and I'll also look into more browser automation.
I'm really happy to improve the language around this. Maybe a simpler change would be to never say "5/5 Ready" but something more like "5/5 no issues apparent"? Would this help? I see it more like CI: just because something is green doesn't mean you should merge it right away. For me, it would be easiest if we continue like this and test it on real PRs. I don't have any other infrastructure or platform where the results are displayed. |
|
@jfilter I agree "No issues found" is better since it's not civireview's job to assess merge readiness (only that the PR is ready to be reviewed by a human). |
|
@colemanw Done. The verdicts are now No issues found, Questions only and Issues found, and the number is just "Score", without stars and without "merge confidence". The Outside this review section states that verdict and score prepare a human review and do not replace it. Also from this PR: conditions for merging that the description states (like "do not merge before 6.23") now lead the To address list, and a change to one CMS integration is recorded on that CMS instead of only on Standalone. |
@colemanw - in the linked issue above (proposed by @seamuslee001 last month) https://lab.civicrm.org/dev/joomla/-/work_items/70 |
|
Thanks @jfilter - all these tweaks will improve it! |
Overview
Work towards dev/joomla#70.
This PR removes all legacy code for Joomla! 3 and earlier versions.
Do not merge before CiviCRM 6.23 (Feb 2027) as this removes J3 support.
Before
Multiple branches of code for J3 and earlier, wrapped in
version_compare()withJVERSIONetc.After
All legacy code removed.
Technical Details
No (intended) functional changes - removing legacy and in theory unreachable code only.
Comments
Briefly tested with Joomla! 5.4.11 and CiviCRM 6.20.1. I doubt have been able to exercise every line. Unit test coverage may not be very good for the affected code areas.