Skip to content

Fix lambda label display#7406

Merged
dlpierce merged 2 commits intomainfrom
fix-lambda-label-display
Mar 31, 2026
Merged

Fix lambda label display#7406
dlpierce merged 2 commits intomainfrom
fix-lambda-label-display

Conversation

@laritakr
Copy link
Copy Markdown
Contributor

Summary

Fix index_field_label crash when label is a lambda without custom_label

#7390 introduced display_label_for, which sets field_config.label to a locale-deferred lambda. The existing guard only invoked lambdas when custom_label was truthy, so .match(/./) was called directly on the Proc, raising NoMethodError.

Added an unconditional respond_to?(:call) guard before the .match check.

Fix index_field_label crash when label is a lambda without custom_label

#7390 introduced display_label_for, which sets
field_config.label to a locale-deferred lambda. The existing guard only
invoked lambdas when custom_label was truthy, so .match(/\./) was called
directly on the Proc, raising NoMethodError.

Added an unconditional respond_to?(:call) guard before the .match check.
@laritakr laritakr added the notes-bugfix Release Notes: Fixed a bug label Mar 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

Test Results

    17 files  ±0      17 suites  ±0   3h 25m 10s ⏱️ - 3m 6s
 7 202 tests +2   6 896 ✅ +2  306 💤 ±0  0 ❌ ±0 
24 117 runs  +8  23 526 ✅ +8  591 💤 ±0  0 ❌ ±0 

Results for commit e52912d. ± Comparison against base commit d3e4d89.

This pull request removes 444 and adds 446 tests. Note that renamed tests count towards both.
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f0b2ce558d8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f82c4195ca0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fa8dcf6f158>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fe6a861e888>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f0b2cf43ad8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f82c41c44d8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fa8dcf7b908>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fe6b3ed7320>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 540446c2-efd4-4b24-ab38-fca6830a2f2e
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: c39178bd-c905-4d14-bcc5-acb1d245de83
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f1e0f825f08>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f517ec6d208>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f8051af4258>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f8bcade4240>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f1e101c3d58>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f517ec7a3e0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f8051be2598>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f8bcaef6a48>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 36ae87d4-adb3-4aa0-892e-d92398ee64e4
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 35597d10-32d0-4476-9735-3b69d6158c64
…

♻️ This comment has been updated with latest results.

@dlpierce dlpierce merged commit a703f60 into main Mar 31, 2026
20 checks passed
@dlpierce dlpierce deleted the fix-lambda-label-display branch March 31, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes-bugfix Release Notes: Fixed a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants