If I'm adding a plain text alternative title field on any content type, for example field_breadcrumb_title and using this field machine name in the easy_breadcrumb settings, the module doesn't use the value of this field in the breadcrumb.
When I'm looking in the file EasyBreadcrumbBuilder.php in the function getTitleString, the titleResolver->getTitle doesn't use the TitleResolver.php from the easy_breadcrumb module but uses the core TitleResolverInterface instead. So it never passes the part in the easy_breadcrumb TitleResolver.php file were the alternative field is being picked up.
Am I right or am I missing something here?
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3254436-11.patch | 1.03 KB | szloredan |
| #10 | 3254436-10.patch | 995 bytes | marcoscano |
| #9 | 3254436-alternative-title-field-not-working.patch | 863 bytes | tavib47 |
Issue fork easy_breadcrumb-3254436
Show commands
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 #2
seppe beelprez commentedComment #3
seppe beelprez commentedComment #4
greg boggsCan you try the dev branch and see if that's better?
Comment #5
seppe beelprez commentedI installed the dev branch together with the latest patch from https://www.drupal.org/project/easy_breadcrumb/issues/3253835 but I can't get the alternative field to work.
Maybe it's a combination of settings, I will try and test various combinations now.
Comment #6
seppe beelprez commentedThis is what I tried to get it working: dev branch + latest patch from here https://www.drupal.org/project/easy_breadcrumb/issues/3253835
Easy Breadcrumb settings:
- Include the current page as a segment in the breadcrumb: enabled
- Include the front page as a segment in the breadcrumb: enabled
- Alternative title field name for breadcrumb: value for this field: field_breadcrumb_title
- Title for the front page segment in the breadcrumb: value for this field: Home
- Follow redirects.: enabled
Then I found out that, even with only the "Alternative title field for breadcrumb", it never executed the part of the code that uses the: getTitleString($route_request, $route_match, $replacedTitles);
What I did instead is add the following on line 554 in EasyBreadcrumbBuilder.php as I assume when you want to use the alternative title field, this should be the most important setting if the node has a value for this field offcourse.
Is it possible for you to check this and try it with the same settings as I have?
Comment #9
tavib47 commentedPatch for 2.0.2 version
Comment #10
marcoscanoPatch in #9 works for me, but it gets stale if the alternative title is changed.
Updated patch adds the entity as a cache dependency to the breadcrumb object (which surprises me wasn't being included yet, but 🤷♂️ )
Comment #11
szloredan commentedReroll for 2.0.3
Comment #12
joakland commentedPatch in #11 works for me.
Comment #13
greg boggsComment #14
greg boggsIt looks like the merge request is still at the patch in #9. If someone updates the merge request with the patch from #11, I'll go ahead and merge this.
Comment #16
omkar-pd commentedUpdated the MR for patch #11 and 2.0.3 as per #14. Moving this to Needs review again.
Comment #17
greg boggsThanks Omkar!
Comment #20
user0249 commented