Skip to content

Conversation

notz
Copy link
Contributor

@notz notz commented Jul 30, 2025

Description

This pull request standardizes the use of single quotes for string literals in SQL queries across multiple files to improve consistency and align with coding standards. The changes primarily affect SQL join conditions in the EmailBundle and PageBundle.

Standardization of string literals in SQL queries:

@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 07:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request standardizes string literal quoting in SQL queries by replacing double quotes with single quotes for the string value "email" across multiple files to improve ANSI SQL compatibility.

  • Updated SQL join conditions to use single quotes instead of double quotes for string literals
  • Affected files span EmailBundle and PageBundle repositories and helper classes
  • Changes maintain existing functionality while improving SQL standard compliance

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
app/bundles/PageBundle/Entity/RedirectRepository.php Updated join condition in getMostHitEmailRedirects to use single quotes for 'email' string literal
app/bundles/EmailBundle/Stats/Helper/UnsubscribedHelper.php Changed join condition in generateStats to use single quotes for 'email' string literal
app/bundles/EmailBundle/Stats/Helper/BouncedHelper.php Modified join condition in generateStats to use single quotes for 'email' string literal
app/bundles/EmailBundle/Entity/StatRepository.php Updated leftJoin condition in getSentEmailToContactData to use single quotes for 'email' string literal

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.83%. Comparing base (fa0653e) to head (f2ff527).
⚠️ Report is 3 commits behind head on 6.0.

Files with missing lines Patch % Lines
app/bundles/EmailBundle/Entity/StatRepository.php 0.00% 1 Missing ⚠️
...bundles/EmailBundle/Stats/Helper/BouncedHelper.php 0.00% 1 Missing ⚠️
...es/EmailBundle/Stats/Helper/UnsubscribedHelper.php 0.00% 1 Missing ⚠️
...p/bundles/PageBundle/Entity/RedirectRepository.php 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                6.0   #15324      +/-   ##
============================================
- Coverage     64.83%   64.83%   -0.01%     
  Complexity    34784    34784              
============================================
  Files          2278     2278              
  Lines        103875   103875              
============================================
- Hits          67344    67343       -1     
- Misses        36531    36532       +1     
Files with missing lines Coverage Δ
app/bundles/EmailBundle/Entity/StatRepository.php 48.32% <0.00%> (ø)
...bundles/EmailBundle/Stats/Helper/BouncedHelper.php 11.76% <0.00%> (ø)
...es/EmailBundle/Stats/Helper/UnsubscribedHelper.php 11.76% <0.00%> (ø)
...p/bundles/PageBundle/Entity/RedirectRepository.php 22.72% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

I'm not sure about this change. The change is only in 4 files so it's not setting a new standard because it's still chaos in all the other files. This also isn't mentioned in any Mautic or Symfony code standards (correct me if I'm wrong) so it comes to a preference of each developer.

I'd find this useful if you'd added a new CS Fixer rule for this and changed it everywhere. But this doesn't add much value I'm afraid.

@escopecz escopecz added the pending-feedback PR's and issues that are awaiting feedback from the author label Aug 6, 2025
@notz
Copy link
Contributor Author

notz commented Aug 6, 2025

@escopecz We use mautic with "ansi" mode currently in production. With the changes from #12919 it's working for us. But I recently discovered an error in the logs, so I checked the code and found these occurrences with wrong encodings. I haven't found more.

escopecz
escopecz previously approved these changes Aug 6, 2025
Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

Interesting. I AI-ed the crap out of this and it looks like a bug fix, not just a cosmetic code style preference:

Image

@escopecz escopecz added bug Issues or PR's relating to bugs landing-pages Anything related to landing pages email Anything related to email code-review-passed PRs which have passed code review and removed pending-feedback PR's and issues that are awaiting feedback from the author labels Aug 6, 2025
@escopecz escopecz added this to the 6.0.4 milestone Aug 6, 2025
@RCheesley
Copy link
Member

Hi @notz this would need to be on the 6.0 branch please, rather than 6.x, to be considered for a release.

@escopecz escopecz added the needs-rebase PR's that need to be rebased label Aug 6, 2025
@RCheesley RCheesley modified the milestones: 6.0.4, 6.0.5 Aug 6, 2025
@notz notz changed the base branch from 6.x to 6.0 August 6, 2025 11:30
@notz notz dismissed escopecz’s stale review August 6, 2025 11:30

The base branch was changed.

@notz
Copy link
Contributor Author

notz commented Aug 6, 2025

@RCheesley @escopecz I changed the base branch and there is no conflict. So it should be ok.

@escopecz escopecz added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed needs-rebase PR's that need to be rebased labels Aug 6, 2025
Copy link

sonarqubecloud bot commented Aug 6, 2025

@escopecz escopecz merged commit d2dfae1 into mautic:6.0 Aug 6, 2025
19 checks passed
@RCheesley RCheesley modified the milestones: 6.0.5, 6.0.4 Aug 6, 2025
@RCheesley
Copy link
Member

As this is merged I have switched the milestone to 6.0.4 as I haven't yet tagged and started the release, so we managed to squeak it in :) Thanks @notz for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs code-review-passed PRs which have passed code review email Anything related to email landing-pages Anything related to landing pages ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants