Closed (fixed)
Project:
Easy Breadcrumb
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2025 at 16:03 UTC
Updated:
16 Jul 2026 at 16:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drupalfan2 commentedComment #3
drupalfan2 commentedThe following patch avoids the infinite while loop.
Comment #6
sriram_s commentedOpened MR !167 to fix this.
Root cause: with "limit segment display" on, a segment count of 0 and the
home segment included, $segment_limit is decremented to -1; the trimming
loop condition count($links) > $segment_limit is then always true and
loops infinitely. A negative value entered directly hits the same path.
Fix: clamp the limit with max(0, $segment_limit) immediately before the
loop, which covers both the 0-with-home-segment case and directly-entered
negative values (broader than the original patch, which guarded only the
home-segment branch).
Tested on Drupal 11.4 / easy_breadcrumb 2.0.9: reproduced the hang with
segment count = 0 + home segment enabled, confirmed the page loads after
the fix, and verified a valid positive limit still trims correctly.
Note: the phpcs pipeline failures are pre-existing coding-standard issues
in files unrelated to this change (src/TitleResolver.php,
easy_breadcrumb.install, .tugboat/config.yml). This MR only edits
src/EasyBreadcrumbBuilder.php; the phpunit and phpstan jobs pass. Happy to
open a separate MR for the standards cleanup if wanted.
Thanks @drupalfan2 for the report and diagnosis.
Comment #7
greg boggs