Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AndreyMaximov’s picture

Issue tags: +CodeSprintCIS

Tag added

AndreyMaximov’s picture

Assigned: Unassigned » AndreyMaximov
AndreyMaximov’s picture

Assigned: AndreyMaximov » Unassigned
Status: Active » Needs review
FileSize
2.58 KB

Status: Needs review » Needs work

The last submitted patch, convert_breadcrumbs-2061913-3.patch, failed testing.

AndreyMaximov’s picture

Status: Needs work » Needs review
FileSize
2.33 KB
andymartha’s picture

@AndreyMaximov, how to test? The patch applies cleanly and I would like to review and push this through. I have built several test views, where are the breadcrumbs?

AndreyMaximov’s picture

I found taxonomy term context argument implements breadcrumb so I had chosen taxonomy/term/% view for testing

@andymartha, the taxonomy example is the only place where this is used now.

You maybe need to apply some of these patches #1857256: Convert the taxonomy listing and feed at /taxonomy/term/%term to Views , cause of changes in taxonomy module API

andymartha’s picture

Been watching that thread, trying to understand it. Maybe work with dawehner before coming back to this thread.

andymartha’s picture

Been watching that thread, trying to understand it. Maybe work with dawehner before coming back to this thread.

jibran’s picture

dawehner’s picture

A different possibility would be to remove the breadcrumb support out of views and create a special one for taxonomy.
On an architecture point of view this totally makes sense, as the breadcrumb system is then separate from views.

dawehner’s picture

Issue tags: +API change

Adding API Change tag do get feedback from one maintainer.

jibran’s picture

jibran’s picture

xjm’s picture

dawehner’s picture

catch’s picture

Priority: Normal » Critical
andypost’s picture

@dawehner I think \Drupal\views\Plugin\views\display\Page::execute() just needs a bit refactoring,
there's no other usage of getBreadcrumb():

$ git grep getBreadcrumb core/modules/views
core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php:87:    $this->view->getBreadcrumb(TRUE);
core/modules/views/lib/Drupal/views/ViewExecutable.php:1705:  public function getBreadcrumb($set = FALSE) {

The idea to inject views breadcrumb builder to breadcrumb service
Probably better to implement this in \Drupal\views\Plugin\views\display\PathPluginBase

+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -1724,10 +1724,10 @@ public function getBreadcrumb($set = FALSE) {
-        if ($base && $current_breadcrumbs = drupal_set_breadcrumb()) {
+        if ($base && $current_breadcrumbs = Drupal::service('views.breadcrumb')->getBreadcrumb()) {
...
-        drupal_set_breadcrumb($breadcrumb);
+        Drupal::service('views.breadcrumb')->setBreadcrumb($breadcrumb);

This should be a kind of

$views_breadcrumb_builder = \Drupal::service('views.breadcrumb');
$views_breadcrumb_builder->setBreadcrumb($breadcrumb);
// @todo Make priority configurable. ref to feature issue
$priority = 1001;
\Drupal::service('breadcrumb')->addBuilder($views_breadcrumb_builder, $priority);

The priorities needs separate issue to revisit before release because services would be fired in the order:

view - 1001
legacy - 500
menu_link - 0

So if no breadcrumbs would be returned by view then legacy (remove) or menu link should build something

Anyway the breadcrumbs service used only in template_preprocess_page():

  // Set the breadcrumb last, so as to increase the chance of being able to
  // re-use the cache of an already retrieved menu containing the active link
  // for the current page.
  // @see menu_tree_page_data()
  $variables['breadcrumb'] = array(
    '#theme' => 'breadcrumb',
    '#breadcrumb' => \Drupal::service('breadcrumb')->build(\Drupal::request()->attributes->all()),
  );

And in \Drupal\system\Plugin\Block\SystemBreadcrumbBlock

  public function build() {
    $breadcrumb_manager = \Drupal::service('breadcrumb');
    $request = \Drupal::service('request');
    $breadcrumb = $breadcrumb_manager->build($request->attributes->all());
    if (!empty($breadcrumb)) {
      // $breadcrumb is expected to be an array of rendered breadcrumb links.
      return array(
        '#theme' => 'breadcrumb',
        '#breadcrumb' => $breadcrumb,
      );
andypost’s picture

Issue summary: View changes

Update

jibran’s picture

Status: Needs review » Needs work
Issue tags: +API change, +VDC, +Approved API change, +CodeSprintCIS

The last submitted patch, convert_breadcrumbs-2061913-5.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review
FileSize
2.12 KB

Here is the start.

dawehner’s picture

Status: Needs review » Needs work

Yeah this is not enough yet, there are other references still, especially in the taxonomy part.

dawehner’s picture

Issue summary: View changes

updated related

andypost’s picture

This only one left here so I closed meta as duplicate of this

@dawehner so we should back to #5 approach?

dawehner’s picture

@dawehner so we should back to #5 approach?

Yes, the patch from jibran in #22 is not enough though I still think that the patch in #5 is fundamentally wrong in the sense
that we no longer need a special breadcrumb system just for views. Core itself is more flexible. For example the taxonomy specialized breadcrumb builder now works in a way that it can support both the normal taxonomy page as well as the view page.

damiankloip’s picture

FileSize
20.1 KB

ok, let's go extreme.

damiankloip’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Nothing is left anymore, nice!!

catch’s picture

Title: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module » Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module
Priority: Critical » Major
Status: Reviewed & tested by the community » Active

Favourite kind of patch.

Committed/pushed to 8.x, thanks!

tstoeckler’s picture

So this didn't actually remove LegacyBreadcrumbBuilder but the parent issue was marked as a dupe of this one?! :-) Was that forgotten here or are there other blockers?

damiankloip’s picture

@tstoeckler, #2145463: Remove LegacyBreadcrumbBuilder. I just saw 'in Views module' and excised everything from there.

tim.plunkett’s picture

Title: Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module » Follow-up and Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module
Status: Active » Needs review
FileSize
2.78 KB

Right.

tim.plunkett’s picture

Title: Follow-up and Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module » Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module
Status: Needs review » Active
dawehner’s picture

Let's use the other issue and write the change request here.

damiankloip’s picture

Good idea, I like things nicely separated. Then we get better commit log, and better change notice issue refs.

So, fixed? or do we want a views change notice for the UI stuff?

jibran’s picture

Title: Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module » Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module
Issue summary: View changes
Status: Needs review » Fixed

Here is the original change notice for meta Extensible breadcrumb system added. So i don't think it needs new one.

dawehner’s picture

Well, we do remove the API from views, so we have to document that.

jibran’s picture

Title: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module » Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module
Project: Drupal core » Views (for Drupal 7)
Version: 8.x-dev » 8.x-3.x-dev
Component: views.module » Documentation
Status: Fixed » Active
Issue tags: +Needs change record

ok moving to the views queue then.

andypost’s picture

What to do with issues like that... close or not?

MustangGB’s picture

Priority: Major » Normal
Chris Matthews’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 9.x-dev
Component: Documentation » views.module

For more information as to why this issue was moved to the Drupal core project, please see issue #3030347: Plan to clean process issue queue

andypost’s picture

Version: 9.x-dev » 8.8.x-dev

This issue is about to create change record for already removed code

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Fixed

The remaining task here is to add a change record for an API removed in Drupal 8.x, before Drupal 8.0 was released. Since Drupal 8 is now end of life there is no need to make a change record.

Even though part of this was not finished, marking this outdated isn't right because a patch was committed here. I am going to set the status to Fixed.

quietone’s picture

Title: Change notice: Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module » Remove drupal_set_breadcrumb and LegacyBreadcrumbBuilder in Views module

Status: Fixed » Closed (fixed)

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

quietone’s picture

Issue tags: -Needs change record

Remove tag,