Skip to content

[#192] Allowed 'LinkHandler' to accept named field properties.#311

Merged
AlexSkrypnyk merged 2 commits intomasterfrom
feature/192-link-named
Apr 16, 2026
Merged

[#192] Allowed 'LinkHandler' to accept named field properties.#311
AlexSkrypnyk merged 2 commits intomasterfrom
feature/192-link-named

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Collaborator

Iterates on #277 by @chrisolof. Thank you for the contribution!

Summary

  • Updated LinkHandler::expand() to accept named field properties (title, uri, options) in addition to the existing numeric index format ([0], [1], [2]).
  • Named keys take precedence over numeric indices via PHP null-coalescing (??), so both formats remain fully supported without breaking existing behaviour.
  • The options key (named or positional) is passed through parse_str() only when present, and defaults to an empty array to satisfy UnroutedUrlAssembler::assemble().

Changes

  • src/Drupal/Driver/Fields/Drupal8/LinkHandler.php - refactored expand() to support named keys alongside numeric indices.

Test plan

  • Verify existing tests pass with numeric-index link values (no regression).
  • Verify a link field populated with named keys (title, uri, options) is correctly expanded.
  • Verify a link field populated with only title and uri (no options) expands without errors.

Closes #192.

… field properties.

Co-authored-by: Christopher O. Caldwell <chrisolof@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Warning

Rate limit exceeded

@AlexSkrypnyk has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 30 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 23 minutes and 30 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be250f33-3252-4d68-93d2-65f33d73c4d1

📥 Commits

Reviewing files that changed from the base of the PR and between df76871 and 19ec058.

📒 Files selected for processing (2)
  • src/Drupal/Driver/Fields/Drupal8/LinkHandler.php
  • tests/Drupal/Tests/Driver/LinkHandlerTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/192-link-named

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 and usage tips.

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.

LinkHandler expects numeric indices

1 participant