Skip to content

fix(speakers): validate photo override exists before clearing - #585

Merged
smarcet merged 1 commit into
mainfrom
fix/speaker-photo-clear-validation
Aug 14, 2026
Merged

fix(speakers): validate photo override exists before clearing#585
smarcet merged 1 commit into
mainfrom
fix/speaker-photo-clear-validation

Conversation

@smarcet

@smarcet smarcet commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

ref:
https://app.clickup.com/t/9014802374/86bb6hm53

Summary

  • SpeakerService::clearSpeakerPhoto / clearSpeakerBigPhoto now throw ValidationException when the speaker has no photo override, instead of silently no-oping.
  • PresentationSpeaker::getProfilePhotoUrl / getBigProfilePhotoUrl no longer fall back to a Gravatar URL; removed the now-unused getGravatarUrl() helper as a result.
  • Trailing-whitespace cleanup on unrelated DQL/SQL query strings in the same file.

Test plan

  • vendor/bin/phpunit tests/Unit/Entities/PresentationSpeakerTest.php tests/SpeakerServiceTest.php — same 4 pre-existing failures with and without this diff (stale DB schema / test fixtures, unrelated to this change).
  • php -l on the modified model file.

Summary by CodeRabbit

  • Bug Fixes
    • Improved speaker profile photo handling by removing unexpected Gravatar fallbacks.
    • Speaker photos now correctly use the resolved photo, configured default image, or no image when unavailable.
    • Added validation to prevent deletion of speaker photos when no corresponding override exists.
    • Standardized the error message shown when speaker photo deletion cannot be completed.

- SpeakerService::clearSpeakerPhoto/clearSpeakerBigPhoto now throw
  ValidationException when the speaker has no photo override, instead
  of silently no-oping.
- PresentationSpeaker::getProfilePhotoUrl/getBigProfilePhotoUrl no
  longer fall back to a Gravatar URL; removed the now-unused
  getGravatarUrl() helper.
- Trailing-whitespace cleanup on unrelated DQL/SQL query strings.
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 57a3e580-27c6-4bfc-a6bf-6d1de4e60680

📥 Commits

Reviewing files that changed from the base of the PR and between d831f1e and d1f8121.

📒 Files selected for processing (2)
  • app/Models/Foundation/Summit/Speakers/PresentationSpeaker.php
  • app/Services/Model/Imp/SpeakerService.php

📝 Walkthrough

Walkthrough

Presentation speaker photo methods now use resolved or configured default URLs without Gravatar fallback. Photo deletion validates speaker type and photo overrides. Presentation query SQL formatting was normalized without changing query behavior.

Changes

Speaker changes

Layer / File(s) Summary
Profile photo URL resolution
app/Models/Foundation/Summit/Speakers/PresentationSpeaker.php
getBigProfilePhotoUrl and getProfilePhotoUrl now return resolved photos, configured defaults, or null after exception handling.
Photo deletion validation
app/Services/Model/Imp/SpeakerService.php
Photo deletion validates the speaker type and requires the corresponding photo override before clearing it.
Presentation query formatting
app/Models/Foundation/Summit/Speakers/PresentationSpeaker.php
Whitespace and SQL string formatting were normalized across presentation and summit queries without changing selection logic.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d1f81

The change makes photo clearing reject speakers without an override and removes the Gravatar fallback; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: validating that a speaker photo override exists before clearing it.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/speaker-photo-clear-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-585/

This page is automatically updated on each push to this PR.

@smarcet
smarcet requested review from romanetar and a lite review from Copilot August 14, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@romanetar romanetar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@smarcet
smarcet merged commit c8c40e1 into main Aug 14, 2026
22 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.

3 participants