fix: drop cHash from generated event detail URLs - #18
Conversation
The event_slug route variable is declared static, but AbstractEnhancer:: applyStaticVariables() intersects the static flags with the route's requirements and event_slug had none. The flag was silently discarded, event_slug stayed a dynamic argument, and PageRouter::generateUri() appended a cHash to every generated event and appointment URL. Add the missing requirement so the static flag applies.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe route enhancer now requires Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This localized change removes unnecessary cHash parameters while preserving the documented event URL shapes; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Looks good to me! |
Problem
Every URL generated for the Event Detail plugin carries a
cHash, even though the site set ships a route enhancer:Cause
PageRouter::generateUri()appends acHashwheneverPageArguments::getDynamicArguments()is non-empty. Instrumenting that call showed:event_uidis static via itsPersistedAliasMapperaspect.event_slugwas not, despitestatic: event_slug: true—AbstractEnhancer::applyStaticVariables()ends withso a
staticflag for a variable with norequirementsentry is silently dropped.event_slughad adefaultsentry but no requirement, so it stayed dynamic.Fix
Add
requirements: { event_slug: '[^/]*' }.[^/]*is Symfony's default path-variable pattern widened to allow the empty default, so inbound matching is unchanged.Verification
Against a real TYPO3 13.4 site (DKFZ intranet, ddev), generated URLs lose the
cHash:/event/1?cHash=cda366…/event/1/event/1?cHash=cda366…/event/1All four documented URL shapes still resolve, each returning HTTP 200:
README updated to record why the requirement has to sit next to the
staticflag.Summary by CodeRabbit
Bug Fixes
cHashparameters from being added to generated event URLs.Documentation