Comments

navneet0693 created an issue. See original summary.

navneet0693’s picture

Status: Active » Needs review
StatusFileSize
new853 bytes
larowlan’s picture

+++ b/core/profiles/demo_umami/themes/umami/umami.theme
@@ -63,7 +63,7 @@ function umami_preprocess_breadcrumb(&$variables) {
   $request = \Drupal::request();

not needed anymore?

larowlan’s picture

Status: Needs review » Needs work

for #3

navneet0693’s picture

Status: Needs work » Needs review

Needed for:

$variables['current_page_title'] = \Drupal::service('title_resolver')->getTitle($request, $route);
larowlan’s picture

Title: Umami Profile - follow up - from #215 on 2809635 - use \Drupal::routeMatch() » Use route match in umami_preprocess_breadcrumb instead of accessing raw request parameters
kim.pepper’s picture

Status: Needs review » Reviewed & tested by the community

LGTM

larowlan’s picture

Status: Reviewed & tested by the community » Needs work

I looked into the logic, and route will always exist, so I think we can clean it up a bit more

We should also fix #2904243-64: Implement the Out of the Box designs as a theme for demo_umami item 2 and 3 too.

Something like this?

/**
 * Implements hook_preprocess_breadcrumb().
 */
function umami_preprocess_breadcrumb(&$variables) {
  $request = \Drupal::request();
  // Search page titles aren't resolved using the title_resolver service - it
  // will always return 'Search' instead of 'Search for [term]', which would
  // give us a breadcrumb of Home >> Search >> Search.
  // @todo Revisit after https://www.drupal.org/project/drupal/issues/2359901
  // @todo Revisit after https://www.drupal.org/project/drupal/issues/2403359
  if (($entity = $request->attributes->get('entity')) && $entity->getEntityTypeId() === 'search_page') {
    $variables['current_page_title'] = $entity->getPlugin()->suggestedTitle();
  }
  else {
    $variables['current_page_title'] = \Drupal::service('title_resolver')->getTitle($request, \Drupal::routeMatch()->getRouteObject());
  }
  // Since we are printing the 'Current Page Title', add the URL cache context.
  // If we don't, then we might end up with something like
  // "Home > Articles" on the Recipes page, which should read "Home > Recipes".
  $variables['#cache']['contexts'][] = 'url';
}
tim.plunkett’s picture

if (($entity = $request->attributes->get('entity')) && $entity->getEntityTypeId() === 'search_page') {
$entity = $route_match->getParameter('entity');
if ($entity instanceof SearchPageInterface) {
navneet0693’s picture

Status: Needs work » Needs review
StatusFileSize
new2.41 KB
jaykandari’s picture

Status: Needs review » Reviewed & tested by the community

@navneet0693: This LGTM.
This does cover #2904243-64: Implement the Out of the Box designs as a theme for demo_umami 2 & 3. 👍🏻

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work

It addresses 64.1, yes
But it completely ignores 64.2 and 64.3

jaykandari’s picture

@tim.plunkett: Sorry, I totally misunderstood it previously.
I have few questions here wrt to 64.2 & 64.3.
64.2: Default core doesn't print current title. Thus we need a hook to add. (I couldn't find it, maybe I'm missing something here).
64.2: Agree here, we should write specifics in their respective modules. But, this is implemented for the demo_umami profile, thus it won't be a good idea to override search module for this specific purpose.

larowlan’s picture

Component: install system » Umami demo
navneet0693’s picture

@tim.plunkett @JayKandari

64.2 Current page title isn't getting printed by default on node pages.
 current page title breadcrumb is missing

64.3 Search results page is also missing the current keyword.
search result page missing keyword from breadcrumb

navneet0693’s picture

Status: Needs work » Needs review
eli-t’s picture

Issue tags: +Nwdug_may18

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

eli-t’s picture

Issue tags: +Novice, +DrupalEurope

This change is still required and the patch looks good. Would be great for someone to A/B test all pages to make sure no behaviour is changed at Drupal Europe.

bserem’s picture

StatusFileSize
new2.43 KB
new496 bytes

Rerolling a new patch since the old one didn't apply anymore (it got old).

Interdiff fails to create something for me, I am attaching a plain diff.

bserem’s picture

StatusFileSize
new153.64 KB

I can't see any visual regressions before and after patch 20 (same as patch 10).
before after patch 20

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good to me and it has been manually tested, as well. Thanks!

The last submitted patch, 10: 2937898_10.patch, failed testing. View results

juliusz_cheddar’s picture

The patch in #20 is applicable.

$ curl https://www.drupal.org/files/issues/2018-09-14/2937898_20.patch | git apply
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2490  100  2490    0     0   9726      0 --:--:-- --:--:-- --:--:--  9726

I tested it manually and I can confirm that there is no visual regression as mentioned in #20.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed e432b65 and pushed to 8.7.x. Thanks!

  • catch committed e432b65 on 8.7.x
    Issue #2937898 by navneet0693, bserem, larowlan, tim.plunkett: Use route...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.