Skip to content

Address review feedback on duplicate class prevention in AZRankingWidget#5323

Closed
Copilot wants to merge 1 commit intoissue/5156from
copilot/sub-pr-5309-again
Closed

Address review feedback on duplicate class prevention in AZRankingWidget#5323
Copilot wants to merge 1 commit intoissue/5156from
copilot/sub-pr-5309-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 18, 2026

Description

Addresses review feedback on PR #5309 regarding an automated review suggestion for preventing duplicate CSS classes in the AZRankingWidget's #after_build callback.

The automated reviewer suggested replacing simple string concatenation with preg_split/in_array/implode logic to prevent duplicate classes. However, as correctly noted by @kevdevlu, #after_build runs only once per element per form build, making duplicate classes impossible. The existing implementation is appropriate:

// Current implementation (correct)
if (str_contains($ranking_link_style, 'link')) {
  if (str_contains($effective_bg, 'bg-oasis') ||
    str_contains($effective_bg, 'bg-sky')) {
    $ranking_link_style .= ' text-midnight';
  }
}

No code changes required - confirmed the simple concatenation approach is correct for this use case.

Release notes

Related issues

Related to PR #5309 and review comment #5309 (comment)

How to test

No testing required - this PR addresses review feedback confirming no changes are needed to the existing implementation.

Types of changes

Arizona Quickstart (install profile, custom modules, custom theme)

  • Patch release changes
    • Bug fix
    • Accessibility, performance, or security improvement
    • Critical institutional link or brand change
    • Adding experimental module
    • Update experimental module
  • Minor release changes
    • New feature
    • Breaking or visual change to existing behavior
    • Upgrade experimental module to stable
    • Enable existing module by default or database update
    • Non-critical brand change
    • New internal API or API improvement with backwards compatibility
    • Risky or disruptive cleanup to comply with coding standards
    • High-risk or disruptive change (requires upgrade path, risks regression, etc.)
  • Other or unknown
    • Other or unknown

Drupal core

  • Patch release changes
    • Security update
    • Patch level release (non-security bug-fix release)
    • Patch removal that's no longer necessary
  • Minor release changes
    • Major or minor level update
  • Other or unknown
    • Other or unknown

Drupal contrib projects

  • Patch release changes
    • Security update
    • Patch or minor level update
    • Add new module
    • Patch removal that's no longer necessary
  • Minor release changes
    • Major level update
  • Other or unknown
    • Other or unknown

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My change requires release notes.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Address feedback on fix for update preview issue Address review feedback on duplicate class prevention in AZRankingWidget Feb 18, 2026
Copilot AI requested a review from kevdevlu February 18, 2026 16:12
@kevdevlu kevdevlu closed this Feb 18, 2026
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