Skip to content

54 deprecated#431

Merged
jonasdekeukelaere merged 17 commits intomasterfrom
54-deprecated
Mar 5, 2026
Merged

54 deprecated#431
jonasdekeukelaere merged 17 commits intomasterfrom
54-deprecated

Conversation

@jonasdekeukelaere
Copy link
Member

@jonasdekeukelaere jonasdekeukelaere commented Mar 4, 2026

https://next-app.activecollab.com/108877/my-work?modal=Task-241720-62

Summary by Sourcery

Remove legacy social media and cookie bar integrations and clean up deprecated APIs and settings now superseded by the privacy consent dialog and newer services.

Enhancements:

  • Drop Facebook and Twitter configuration, output, and template globals from settings UI, header/footer rendering, JS, Twig templates, and locale resources.
  • Remove the old cookie bar UI, logic, translations, and related settings in favor of the privacy consent dialog, including its impact on Google Analytics anonymization.
  • Simplify site-wide HTML header/body settings by dropping fallbacks to deprecated configuration keys and aligning theme templates with the current variables.
  • Delete unused or deprecated helper methods across core and modules (thumbnail/coordinates helpers, locale sorting, cookie helpers, meta and CKFinder deprecation attributes, etc.) and tighten visibility on internal APIs.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 4, 2026

Reviewer's Guide

Removes a wide range of deprecated features (Facebook/Twitter integration, legacy cookie bar, old HTML injection settings, and various deprecated helpers) and aligns templates, JS, and configuration to rely solely on the newer consent dialog and current settings APIs.

Sequence diagram for page load with consent dialog and Google Analytics

sequenceDiagram
    actor Visitor
    participant Browser
    participant Frontend_Page as Frontend_Page
    participant ConsentDialog as Privacy_ConsentDialog
    participant Settings as ModulesSettings
    participant Cookie as CookieService
    participant GA as GoogleAnalytics

    Visitor->>Browser: Request page
    Browser->>Frontend_Page: HTTP request
    Frontend_Page->>Settings: get Core.show_consent_dialog
    Settings-->>Frontend_Page: show_consent_dialog flag
    Frontend_Page->>ConsentDialog: shouldDialogBeShown()
    ConsentDialog->>Settings: get Core.show_consent_dialog
    Settings-->>ConsentDialog: flag
    ConsentDialog-->>Frontend_Page: boolean
    Frontend_Page->>Browser: Render page with consent_dialog_template

    Note over Browser,GA: Legacy cookie bar and cookieBarHide
    Note over Browser,GA: logic have been removed

    Browser->>GA: Initialize GoogleAnalytics
    GA->>Settings: get Core.show_consent_dialog
    Settings-->>GA: flag
    GA->>Cookie: read consent cookies
    Cookie-->>GA: consent state
    GA-->>Browser: add GA script (with or without anonymize)
    Browser-->>Visitor: Page rendered with consent dialog only
Loading

Flow diagram for cleaned up site HTML settings handling

flowchart LR
    A[Backend_Settings_form_load] --> B[Read Core.site_html_head]
    A --> C[Read Core.site_html_start_of_body]
    A --> D[Read Core.site_html_end_of_body]

    B --> E[Form_field site_html_head]
    C --> F[Form_field site_html_start_of_body]
    D --> G[Form_field site_html_end_of_body]

    E --> H[Validate_form]
    F --> H
    G --> H

    H --> I[Save Core.site_html_head]
    H --> J[Save Core.site_html_start_of_body]
    H --> K[Save Core.site_html_end_of_body]

    I --> L[Frontend_Header_parse]
    J --> M[Frontend_Header_parse]
    K --> N[Frontend_Footer_parse]

    L --> O[Assign siteHTMLHead]
    M --> P[Assign siteHTMLStartOfBody]
    N --> Q[Assign siteHTMLEndOfBody]

    O --> R[Templates_render_head_using_siteHTMLHead]
    P --> S[Templates_render_body_start_using_siteHTMLStartOfBody]
    Q --> T[Templates_render_body_end_using_siteHTMLEndOfBody]

    subgraph Removed_legacy_fallbacks_and_globals
      U[Core.site_html_header]
      V[Core.site_start_of_body_scripts]
      W[Core.site_html_footer]
      X[Template_globals_siteHTMLHeader]
      Y[Template_globals_siteHTMLFooter]
    end

    U -. no_longer_used .- A
    V -. no_longer_used .- A
    W -. no_longer_used .- A
    X -. removed .- R
    Y -. removed .- T
Loading

File-Level Changes

Change Details Files
Remove deprecated social integration settings and runtime behaviour (Facebook/Twitter) from backend, frontend, and Twig globals.
  • Delete Facebook and Twitter labels/messages from backend locale definitions and test DB seed data.
  • Remove Facebook app ID–based HTML injection and helper methods from the frontend footer and header.
  • Drop Facebook/Twitter settings fields, validation, and JS helpers from the backend settings action, JS, and Twig template.
  • Stop exposing FACEBOOK_* and TWITTER_* Twig globals in the base Twig template.
  • Delete the dedicated Frontend Core Facebook header class file.
src/Backend/Modules/Settings/Installer/Data/locale.xml
tests/data/test_db.sql
src/Frontend/Core/Engine/Footer.php
src/Frontend/Core/Header/Header.php
src/Backend/Modules/Settings/Actions/Index.php
src/Backend/Modules/Settings/Layout/Templates/Index.html.twig
src/Backend/Modules/Settings/Js/Settings.js
src/Common/Core/Twig/BaseTwigTemplate.php
src/Frontend/Core/Header/Facebook.php
Remove legacy cookie bar feature in favour of the privacy consent dialog across backend, frontend, JS, cookies, analytics, and styling.
  • Remove cookie bar help text, labels, settings fields, and persistence from backend locale, DB test data, and settings form/template.
  • Drop cookie-bar related globals and logic from the frontend page controller and notifications template.
  • Remove jsFrontend.cookieBar implementation and all cookie-bar HTML includes from core and theme base templates.
  • Delete cookie bar SCSS partials and their imports from both Bootstrap and Fork themes.
  • Remove deprecated cookie helper methods and cookie-bar‑based anonymization logic in the Google Analytics header.
src/Backend/Modules/Settings/Installer/Data/locale.xml
tests/data/test_db.sql
src/Backend/Modules/Settings/Actions/Index.php
src/Backend/Modules/Settings/Layout/Templates/Index.html.twig
src/Frontend/Core/Engine/Page.php
src/Frontend/Themes/Bootstrap/src/Layout/Templates/Notifications.html.twig
src/Frontend/Core/Js/frontend.js
src/Frontend/Core/Layout/Templates/Base.html.twig
src/Frontend/Themes/Bootstrap/src/Layout/Templates/Base.html.twig
src/Frontend/Themes/Fork/Core/Layout/Templates/Base.html.twig
src/Common/Core/Cookie.php
src/Frontend/Core/Header/GoogleAnalytics.php
src/Frontend/Themes/Bootstrap/src/Layout/Sass/components/_cookiebar.scss
src/Frontend/Themes/Fork/Core/Layout/Sass/components/_cookiebar.scss
src/Frontend/Themes/Bootstrap/src/Layout/Sass/screen.scss
src/Frontend/Themes/Fork/Core/Layout/Sass/screen.scss
src/Frontend/Core/Layout/Templates/Cookies.html.twig
src/Frontend/Themes/Fork/Core/Layout/Templates/Cookies.html.twig
Drop or tighten various deprecated PHP APIs and constants across the core and modules.
  • Remove deprecated thumbnail helper methods from the common Model in favour of the Thumbnails service.
  • Drop deprecated location geocoding wrapper and locale-analysis helper methods that are no longer used.
  • Remove deprecated cookie and LAST_MODIFIED_TIME constants from Init and Kernel bootstrapping.
  • Make some previously public/annotated methods private now that external use is deprecated (e.g. Authentication::getAllowedActions, Pages::createHtml).
  • Remove deprecated attributes/annotations from meta and Twig-related methods and CKFinder events that are staying for now but are no longer advertised as deprecated.
  • Clean up deprecated session and media gallery template assignments and comments.
src/Common/Core/Model.php
src/Backend/Modules/Location/Engine/Model.php
src/Backend/Modules/Locale/Engine/AnalyseModel.php
src/Common/Core/Init.php
app/Kernel.php
src/Backend/Core/Engine/Authentication.php
src/Backend/Modules/Pages/Engine/Model.php
src/Backend/Core/Engine/TwigTemplate.php
src/Backend/Modules/MediaGalleries/Actions/MediaGalleryAdd.php
src/Backend/Modules/MediaGalleries/Actions/MediaGalleryEdit.php
src/Backend/Core/Js/ckfinder/core/connector/php/CKSource/CKFinder/Acl/Permission.php
src/Backend/Core/Js/ckfinder/core/connector/php/CKSource/CKFinder/Event/*.php
src/Backend/Core/Engine/Meta.php
Simplify and modernize handling of site-wide HTML injection settings (head/start-of-body/end-of-body).
  • Stop falling back to legacy settings keys (site_html_header, site_start_of_body_scripts, site_html_footer) when reading site_html_* values in the frontend header and backend settings.
  • Adjust backend settings form to use site_html_* values as both primary and default, and to write back only to the modern keys.
  • Update theme templates to render siteHTMLHead/siteHTMLEndOfBody directly instead of legacy siteHTMLHeader/siteHTMLFooter intermediates.
  • Remove deprecated template globals for legacy site HTML keys from the footer and header parsing logic.
src/Backend/Modules/Settings/Actions/Index.php
src/Frontend/Core/Engine/Footer.php
src/Frontend/Core/Header/Header.php
src/Frontend/Themes/Bootstrap/src/Layout/Templates/Base.html.twig
src/Frontend/Themes/Fork/Core/Layout/Templates/Base.html.twig
Minor cleanups, comments, and bugfix-level adjustments.
  • Fix a misleading comment in ConsentDialog::shouldDialogBeShown to reference the consent dialog instead of the cookie bar.
  • Tidy whitespace and docblocks in CKFinder Permission and event classes.
  • Remove unused LAST_MODIFIED_TIME handling in Init, relying instead on more modern mechanisms.
src/ForkCMS/Privacy/ConsentDialog.php
src/Common/Core/Init.php
src/Backend/Core/Js/ckfinder/core/connector/php/CKSource/CKFinder/Acl/Permission.php
src/Backend/Core/Js/ckfinder/core/connector/php/CKSource/CKFinder/Event/*.php

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • In Backend/Modules/Settings/Actions/Index::loadForm and validateForm, the site_html_start_of_body and site_html_end_of_body settings are now read and written redundantly (same key as value and fallback, and each key is set twice); consider simplifying these calls to a single read/write per key to avoid confusion.
  • You removed the Twitter settings UI and persistence in validateForm, but loadForm still adds the twitter_site_name field; it may be clearer to remove the field creation entirely if the setting is no longer supported.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `Backend/Modules/Settings/Actions/Index::loadForm` and `validateForm`, the `site_html_start_of_body` and `site_html_end_of_body` settings are now read and written redundantly (same key as value and fallback, and each key is set twice); consider simplifying these calls to a single read/write per key to avoid confusion.
- You removed the Twitter settings UI and persistence in `validateForm`, but `loadForm` still adds the `twitter_site_name` field; it may be clearer to remove the field creation entirely if the setting is no longer supported.

## Individual Comments

### Comment 1
<location path="src/Backend/Modules/Settings/Actions/Index.php" line_range="483-484" />
<code_context>
-                );
-
-                // twitter settings
-                /** @var \SpoonFormText $txtTwitterSiteName */
-                $txtTwitterSiteName = $this->form->getField('twitter_site_name');
-                if ($txtTwitterSiteName->isFilled()) {
-                    $this->get('fork.settings')->set(
</code_context>
<issue_to_address>
**question (bug_risk):** The `twitter_site_name` field is still created but is no longer persisted, which may lead to confusing behavior.

In `loadForm()` the `twitter_site_name` field is still added, but the save logic in `validateForm()` is removed. With the Twitter panel also gone from the Twig template, existing values will appear in the form but any edits won’t be persisted. Please either remove the form field entirely if Twitter config is being dropped, or keep the persistence logic (or a clear alternative) until the feature is fully removed to avoid this inconsistent behavior.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jonasdekeukelaere jonasdekeukelaere merged commit 64ab951 into master Mar 5, 2026
9 of 12 checks passed
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

Successfully merging this pull request may close these issues.

2 participants