Closed (fixed)
Project:
Easy Breadcrumb
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2026 at 02:03 UTC
Updated:
13 Sep 2026 at 17:30 UTC
Jump to comment: Most recent
There currently is no test for the "Make the language path prefix a segment" (LANGUAGE_PATH_PREFIX_AS_SEGMENT) config.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
loopduplicate commentedComment #4
csakiistvanComment #5
csakiistvan✅ Tested and works — MR !215.
Environment
5bfef4e)Prerequisites
2.xbranch inside a Drupal 11.4.4 site.grep -rn LANGUAGE_PATH_PREFIX_AS_SEGMENT web/modules/contrib/easy_breadcrumb/tests/returns no matches.Steps
tests/src/Functional/EasyBreadcrumbLanguagePathPrefixAsSegmentTest.php, which adds a Hungarian language, creates a translated node aliased/test-page, and checks thehuprefix on/hu/test-page— absent by default, still absent with Include invalid paths alone, and present once Make the language path prefix a segment is enabled.ddev drush crsrc/EasyBreadcrumbBuilder.php(line 495) withTRUE, so the prefix is always stripped, and run the test again.FALSE, so the prefix is never stripped, and run the test again.src/EasyBreadcrumbBuilder.phpand run the test a final time.Expected results
2.x.Actual results
Before the fix no test referenced
LANGUAGE_PATH_PREFIX_AS_SEGMENT, so the setting was completely uncovered. After applying MR !215 the new test ran green (1 test, 8 assertions; only pre-existing unrelated deprecation notices). Both mutations are caught: with the condition forced toTRUEthe test fails withThe string "Hu" was not found in the HTML of the element matching css "#block-breadcrumb li:nth-child(2)", and withFALSEit fails withThe string "Hu" appears in the HTML of the element matching css "#block-breadcrumb li:nth-child(2)", but it should not.— so both the enabled and the disabled behaviour are pinned. The extra step with Include invalid paths is a good guard, since that option is the obvious way an unintended language segment could sneak back in. Reverting the builder restored a green run.phpcs --standard=Drupal,DrupalPracticereports no issues on the test file.Testing produced with the assistance of an LLM.
Comment #6
loopduplicate commentedMarking this as needs review per comments in the MR. A change was made to allow to showing the language segment without allowing invalid paths.
Comment #7
greg boggsIt's not just a test add: the Aug 14 update also changes the source so the language-prefix segment can show on its own, without needing INCLUDE_INVALID_PATHS enabled too.
Ran the full suite with the MR applied: 38/38 pass. Then reverted just the source change and kept the test: it failed, showing "Test Page" instead of "Hu." So the source fix is actually needed, not dead code.
AI was used in assisting to test this issue
Comment #8
loopduplicate commentedComment #10
loopduplicate commentedThank you @greg boggs and @csakiistvan :3