Problem/Motivation

In Drupal 7, thanks to the implementation of l(), an "active" class was automatically added when generating node listing with views, and when the linked entity's URI was the same as the one listed.

With #1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links, this is not the case any more and it's been reported to not be not easily alterable.

Proposed resolution

Re add the feature as optional, via means of adding a new checkbox form field to control whether or not the active class on links will be enabled. Adding of the actual CSS class is performed via JS.

Remaining tasks

  1. Write the patch
  2. Review it
  3. Add test coverage for the new feature.
  4. Write upgrade path to update existing views on sites.
  5. Write upgrade path test to verify it works.

User interface changes

New Set the active class on links checkbox on views field options. Description: If checked, if the fields link to the current page, an "is-active" class will be added on active links.

Views style settings

API changes

New set_active_class boolean on views.row.schema

Data model changes

N/A

Release notes snippet

Views can now optionally add the "active" css class.

Original description

In Drupal 7, thanks to the implementation of l(), an "active" class was automatically added when generating node listing with views, and when the linked entity's URI was the same as the one listed.

With #1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links, this is not the case anymore and it seem's not easily alterable (I can't my way through).

Is there a way to change this behaviour. Are we missing something in core to let us alter that ?

CommentFileSizeAuthor
#159 2652000-10-4-159.patch38.01 KBdmundra
#158 2652000-158.patch37.94 KBdmundra
#154 without_patch_applied_config_enabled_html.png40.97 KBgabriel.passarelli
#154 without_patch_applied_config_enabled_view.png27.17 KBgabriel.passarelli
#154 patch_applied_config_disabled.png39.27 KBgabriel.passarelli
#154 patch_applied_config_enabled_view.png39.78 KBgabriel.passarelli
#154 patch_aplied_config_enabled_html.png41.48 KBgabriel.passarelli
#151 2652000-151.patch36.27 KB_pratik_
#149 2652000-9.4.10.patch55.12 KBjmsomera
#145 view active class 2652000.patch54.1 KBsauravkashyap
#144 view active class 2652000.patch54.1 KBsauravkashyap
#143 drupal-2652000-143.patch55.11 KBprudloff
#139 interdiff_2652000-136-139.txt718 bytesranjith_kumar_k_u
#139 2652000-139.patch54.99 KBranjith_kumar_k_u
#138 interdiff-2652000-136.9.3_138.txt969 bytesgauravvvv
#138 2652000-138.patch59.07 KBgauravvvv
#136 2652000-136.patch55.24 KBgaëlg
#136 2652000-136-9.3.patch55.22 KBgaëlg
#128 interdiff_126-127.txt1.4 KBramya balasubramanian
#128 views-do-not-have-active-classes-2652000-127.patch60.52 KBramya balasubramanian
#126 interdiff_125-126.txt2.62 KBramya balasubramanian
#126 views-do-not-have-active-classes-anymore-2652000-126.patch60.78 KBramya balasubramanian
#125 interdiff_123-125.txt761 bytesramya balasubramanian
#125 views-do-not-have-active-classes-2652000-125.patch60.5 KBramya balasubramanian
#123 interdiff_122-123.txt7.43 KBramya balasubramanian
#123 views-do-not-have-active-class-anymore-2652000-123.patch60.4 KBramya balasubramanian
#122 interdiff_117-122.txt2.58 KBramya balasubramanian
#122 views-do-not-have-active-class-anymore-2652000-122.patch56.28 KBramya balasubramanian
#118 interdiff-2652000-106-115.txt7.48 KBmanuel garcia
#117 interdiff-2652000-115-117.txt2.18 KBmanuel garcia
#117 2652000-117.patch54.1 KBmanuel garcia
#115 interdiff.2652000.111-115.txt1.79 KBaleevas
#115 2652000-9.1-115.patch54.3 KBaleevas
#115 2652000-8.9-115.patch54.3 KBaleevas
#112 2652000-8.9-111.patch54.32 KBaleevas
#112 interdiff.2652000.8_9.106-111.txt18.66 KBaleevas
#111 interdiff.2652000.106-111.patch20.31 KBaleevas
#111 2652000-9.1-111.patch54.32 KBaleevas
#106 2652000-106.patch54.99 KBmanuel garcia
#105 2652000-105.patch58.38 KBmanuel garcia
#105 interdiff-2652000-103-105.txt1.54 KBmanuel garcia
#105 Style-settings-2652000.png23.37 KBmanuel garcia
#103 2652000-103.patch54.97 KBmanuel garcia
#102 2652000-102.patch58.35 KBmanuel garcia
#102 interdiff-2652000-101-102.txt46.35 KBmanuel garcia
#101 2652000-101.patch20.46 KBmanuel garcia
#99 2652000-99.patch20.39 KBmanuel garcia
#99 interdiff-2652000-96-99.txt12.48 KBmanuel garcia
#96 diff-2652000-94-96.txt5.02 KBmanuel garcia
#96 2652000-96.patch13.86 KBmanuel garcia
#94 2652000-94.patch13.85 KBmanuel garcia
#94 interdiff-2652000-93-94.txt8.62 KBmanuel garcia
#93 2652000-93.patch11.33 KBmanuel garcia
#90 2652000-90.patch11.31 KBmanuel garcia
#90 interdiff-2652000-88-90.txt821 bytesmanuel garcia
#88 2652000-88.patch11.12 KBmanuel garcia
#88 interdiff-2652000-84-88.txt7.81 KBmanuel garcia
#84 2652000-84.patch3.33 KBandypost
#84 interdiff.txt871 bytesandypost
#83 2652000-83.patch3.33 KBandypost
#83 interdiff.txt1.13 KBandypost
#78 interdiff-76-78.txt828 bytesaaronbauman
#78 views-active_link_class-2652000-78.patch3.29 KBaaronbauman
#76 interdiff.txt3.89 KBplach
#76 views-active_link_class-2652000-76.patch3.4 KBplach
#67 2652000-67.patch3.39 KBMerryHamster
#3 capture_35d4e1d.png104.04 KBhaza
#6 views_do_not_add_the-2652000-6.patch2.44 KBhaza
#6 capture_6ae2198.png44.83 KBhaza
#6 capture_8367559.png123.5 KBhaza
#9 views_do_not_add_the-2652000-8.patch2.45 KBhaza
#11 views_do_not_add_the-2652000-11.patch3.01 KBhaza
#15 views_do_not_add_the-2652000-15.patch3.33 KBhaza
#25 views_do_not_add_the-2652000-25.patch3.3 KBPavan B S
#28 active_class.png135.98 KBMerryHamster
#28 views_do_not_add_the-2652000-28.patch3.3 KBMerryHamster
#30 views_do_not_add_the-2652000-30.patch3.3 KBgaurav.kapoor
#31 views_do_not_add_the-2652000-31.patch3.29 KBMerryHamster
#37 2652000-37.patch3.72 KBharsha012
#39 2652000-39.patch3.61 KBharsha012
#41 interdiff.txt1.03 KBmanuel garcia
#41 2652000-41.patch3.31 KBmanuel garcia
#43 interdiff.txt1.02 KBmanuel garcia
#43 2652000-43.patch3.31 KBmanuel garcia
#45 interdiff.txt3.53 KBmanuel garcia
#45 2652000-45.patch3.27 KBmanuel garcia
#50 interdiff.txt1.25 KBmanuel garcia
#50 2652000-50.patch3.24 KBmanuel garcia
#59 2652000-59.patch3.27 KBbohart
#59 2652000-59.interdiff.txt908 bytesbohart
#64 interdiff_59-64.txt816 bytesc-logemann
#64 2652000-64.patch3.39 KBc-logemann

Issue fork drupal-2652000

Command icon 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

Haza created an issue. See original summary.

dawehner’s picture

In D8 we have two mechanisms:

  • For anonymous users we still add the active class
  • For authenticated users we use javascript to add the class, as this allows for better cacheability.
haza’s picture

StatusFileSize
new104.04 KB

Thanks for the feedback Daniel.

I saw the 2 mechanisms while I was investigating on what was going on.

Here is a screenshot (left loggued as admin, right as anonymous, d-8.0.x).
The views (block) is displaying the nodes on the site, and the browser is on /node/2. That means (from what I understand) that we should have the "active" class on the "node 2" link.

Is there something missing on view's side ?

haza’s picture

dawehner’s picture

Mh, afaik views is not doing anything special here, maybe later I'll have a deeper look into it.

haza’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.44 KB
new44.83 KB
new123.5 KB

Here is a try.
Since the generation of the "active" class is now an opt-in feature, I also made it as an opt-in option in views. I added a new option in the "Row style options" (since we want to add them when displaying fields)

Here is a screenshot of the option.

Using this option make views generate link fields (ie: the title of a node) with the "active" class if we are linking to the same page as the one currently displayed.

patched

haza’s picture

Category: Support request » Bug report

Status: Needs review » Needs work

The last submitted patch, 6: views_do_not_add_the-2652000-6.patch, failed testing.

haza’s picture

Status: Needs work » Needs review
StatusFileSize
new2.45 KB

Status: Needs review » Needs work

The last submitted patch, 9: views_do_not_add_the-2652000-8.patch, failed testing.

haza’s picture

Status: Needs work » Needs review
StatusFileSize
new3.01 KB

Oops, I forgot to update the schema. Here it is :)

haza’s picture

Issue summary: View changes
dawehner’s picture

In general I think this should NOT be an option on the row but rather on the field itself. This is more of a logical place to look for, when users would try to find it, IMHO.

duaelfr’s picture

Status: Needs review » Needs work

@dawehner Where in the field settings would you see this option ?

haza’s picture

StatusFileSize
new3.33 KB

I'm "just" uploading a new patch with a simple addition. It now also check for the addition of the active class if we rewrite the output of the link (displaying as link).

No change about the position of the settings right now. (thus leaving the status as "need work")

dawehner’s picture

I'm still a bit confused why we need that in views but not in other places in core. It sounds like a feature/setting we want for the normal link generation as well.

haza’s picture

I'm not sure to get your point dawehner. Since core set this option (set_active_class) as FALSE by default, it is the responsability of each application that want to set this as TRUE to change the behaviour.

And since we'd like to be able to generate active classes when using views, I guess this should be on views' side.

Otherwise, we could also say that we want to change the behaviour site's wise. There might be some place for a contrib module to do so.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mac_weber’s picture

Status: Needs work » Reviewed & tested by the community

Changing status. Lets see if test bot can get the latest patch.

mac_weber’s picture

Status: Reviewed & tested by the community » Needs review

oops, wrong status

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

simon.westyn’s picture

@Haza, great patch! Thank you, it works perfectly.

willeaton’s picture

Nice to have as a patch, but this was all 9 months ago. Has it not gone into core?

Pavan B S’s picture

StatusFileSize
new3.3 KB

Rerolled the patch, please review

MerryHamster’s picture

Assigned: Unassigned » MerryHamster

Cheking

MerryHamster’s picture

Version: 8.3.x-dev » 8.4.x-dev
MerryHamster’s picture

StatusFileSize
new135.98 KB
new3.3 KB

Checked the patch for 8.4-dev. Works fine.
active class

andypost’s picture

Status: Needs review » Needs work
+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -36,6 +36,7 @@ protected function defineOptions() {
+    $options['generate_active_class'] = array('default' => FALSE);

this line should use short array syntax

gaurav.kapoor’s picture

Status: Needs work » Needs review
StatusFileSize
new3.3 KB
MerryHamster’s picture

StatusFileSize
new3.29 KB

Fixed bugs with array syntax.

MerryHamster’s picture

Assigned: MerryHamster » Unassigned
gaurav.kapoor’s picture

@merryhamster : Thanks for patch in #28.suggestion in #29 were taken up in #30.

caldenjacobs’s picture

Status: Needs review » Reviewed & tested by the community

#31 looks ready for prime time. Let's get this committed!

wim leers’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +String change in 8.4.0, +Needs usability review
  1. +++ b/core/modules/views/config/schema/views.row.schema.yml
    @@ -14,6 +14,9 @@ views.row.fields:
    +      label: 'Generate active class on links'
    
    +++ b/core/modules/views/src/Plugin/views/row/Fields.php
    @@ -57,6 +58,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    +      '#title' => $this->t('Generate active class on links'),
    

    'Generate "active" class for links'

    Also: string addition, will need review.

  2. +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
    @@ -1154,6 +1154,11 @@ public function advancedRender(ResultRow $values) {
    +          // Setting the active class in a link is now an opt-in feature, so
    

    s/in a link/on a link/

  3. +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
    @@ -1154,6 +1154,11 @@ public function advancedRender(ResultRow $values) {
    +          // we need to check if the features is activated for this views.
    

    s/this views/this view/

  4. +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
    @@ -1383,6 +1388,7 @@ protected function renderAsLink($alter, $text, $tokens) {
    +      'set_active_class' => !empty($this->view->rowPlugin->options['generate_active_class']) ? TRUE : FALSE,
    

    The ternary opterator here can be removed.

csedax90’s picture

#31 works like a charm (I think it could be only a little bit cleaned) with 8.3.3. Could be ported on 8.3.4?

harsha012’s picture

Status: Needs work » Needs review
StatusFileSize
new3.72 KB

As per #35 fixed the issue.

Status: Needs review » Needs work

The last submitted patch, 37: 2652000-37.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

harsha012’s picture

Status: Needs work » Needs review
StatusFileSize
new3.61 KB

minor changes

Status: Needs review » Needs work

The last submitted patch, 39: 2652000-39.patch, failed testing. View results

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB
new3.31 KB

This should fix the failing tests.

Status: Needs review » Needs work

The last submitted patch, 41: 2652000-41.patch, failed testing. View results

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new1.02 KB
new3.31 KB

Let's try that again.

Bojhan’s picture

Issue tags: -Needs usability review

The only change I would make is go with "Add" and not "Generate".

manuel garcia’s picture

StatusFileSize
new3.53 KB
new3.27 KB

Thanks @Bojhan, that makes sense. Doing that in this patch.
I've also changed the option to add_active_class in order to keep things consistent in the code.

csedax90’s picture

Only a question, if you group by a field (For example if you group all the products for their parent category and also this should be linked), the is-active class is correctly added to product when I'm inside it, but not to the grouped link if I come back to one level (I hope I explained myself)

c-logemann’s picture

I successfully applied #45 patch on an actual 8.3.4 system and it works fine. So +1 for RTBC.

This feature is essential for me in D8 because I usually create dynamic menus with views and love this feature in D7.

caldenjacobs’s picture

@C_Logemann — if you're building dynamic menus with Views, check out the little-known Link Trail by Path module as well!

This works as an alternative to patching Views—on almost all site content, not just Views—and also adds active-trail functionality:

https://www.drupal.org/project/link_trail_by_path

crtlf’s picture

Patch #45 works fine for me too, thank you !

manuel garcia’s picture

StatusFileSize
new1.25 KB
new3.24 KB

Fixing a comment nitpick mentioned in #35.2 and changing my tests failure fix to be more in line with #35.4, which makes more sense.

Version: 8.4.x-dev » 8.5.x-dev

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

pavelculacov’s picture

Tested, worrked

caldenjacobs’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Category: Bug report » Task
Status: Reviewed & tested by the community » Needs work
Issue tags: -String change in 8.4.0 +String change in 8.5.0, +Needs tests

We're missing test coverage for the new functionality. This is not a bug but by design. The active class handling was changed in Drupal 8 for performance. See https://www.drupal.org/node/2167077

firfin’s picture

-- MY BAD: patch from #54 is working for me after all. Thanks, olafski

Original message:
Applying the patch manually to 8.4 doesn't seem to do anything. No active class added.
Is there some additional configuration / setting needed?

olafski’s picture

@firfin, the patch in #50 worked for me on Drupal 8.4.2. To see the result I had to clear all caches after applying the patch.

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

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

xjm’s picture

Issue tags: -String change in 8.5.0

Please only tag string changes after the issue is actually committed. Thanks!

bohart’s picture

StatusFileSize
new3.27 KB
new908 bytes

$item['rendered'] can be an object of Markup, not a PHP array.
This will cause a fatal error (that's happened for me).
Fixed the issue, patch attached.

andypost’s picture

@bohart which kind of MarkupInterface object you get there?

I'd say wont-fix because d8 set active class at front side & this change will break all caching in views
There's change record https://www.drupal.org/node/2167077
According that setting active class is set via drupal.active-link library https://cgit.drupalcode.org/drupal/tree/core/core.libraries.yml#n72
The code is https://cgit.drupalcode.org/drupal/tree/core/misc/active-link.js so probably here some bug with views field plugins render of links
Or somehow theme or custom-whatever excludes library from pages - needs to dig

  1. +++ b/core/modules/views/config/schema/views.row.schema.yml
    @@ -14,6 +14,9 @@ views.row.fields:
    +    add_active_class:
    

    this will require to update all saved views! so needs upgrade patch and tests

  2. +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
    @@ -1154,6 +1154,11 @@ public function advancedRender(ResultRow $values) {
    +          if (!empty($this->view->rowPlugin->options['add_active_class']) && is_array($item['rendered']) && !empty($item['rendered']['#url'])) {
    

    Better to check that "rendered" is of renderable interface
    very probably #url could be found in context of renderable element
    Means need explicit tests for both cases

andypost’s picture

Checked core usage of system_page_attachments() is the only now

  // Handle setting the "active" class on links by:
  // - loading the active-link library if the current user is authenticated;
  // - applying a response filter if the current user is anonymous.
  // @see \Drupal\Core\Link
  // @see \Drupal\Core\Utility\LinkGenerator::generate()
  // @see template_preprocess_links()
  // @see \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter
  if (\Drupal::currentUser()->isAuthenticated()) {
    $page['#attached']['library'][] = 'core/drupal.active-link';
  }

On other hand this option could be useful at view level to attach core's core/drupal.active-link but that affects whole page...
So maybe better to name it kinda "Add view option to bubble up core/drupal.active-link library"

Not clear why that library works only for data-drupal-link-system-path data attribute
and only for menu links https://www.drupal.org/node/2281785

Or core hides this attribute from anonymous users for reason?

andypost’s picture

maybe js could filter somehow window.location of brower additionally to route naming for links - looks more markup related

dawehner’s picture

+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -57,6 +58,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+    $form['add_active_class'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t('Add active class on links'),
+      '#default_value' => $this->options['add_active_class'],
+      '#description' => $this->t('If checked, if the fields link to the current page, an "is-active" class will be added on the link.'),
+    ];

Given that this results into the view being less cacheable, I'm wondering whether we could tell tha t the user somehow.

c-logemann’s picture

StatusFileSize
new3.39 KB
new816 bytes

@dawehner: Yes we should tell the user that this feature has an impact on caching.
I think it's enough to extend the description text with a warning.

Suggestion (also see patch and interdiff):
"If checked, if the fields link to the current page, an "is-active" class will be added on the link. WARNING: This feature limits the caching possibilities of this view and should only be enabled when needed."

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.

chi’s picture

+++ b/core/modules/views/config/schema/views.row.schema.yml
@@ -14,6 +14,9 @@ views.row.fields:
+      label: 'Add "active" class on links'
+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -57,6 +58,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+      '#title' => $this->t('Add active class on links'),

There is a slight discrepancy here. Can we enclose the word "active" with quotes on the form element as well?

MerryHamster’s picture

StatusFileSize
new3.39 KB

Reroll #64 patch for 8.7.x and added fix for #66.

MerryHamster’s picture

Status: Needs work » Needs review
andypost’s picture

It also needs upgrade path for existing views & tests (including cachability)

+++ b/core/modules/views/config/schema/views.row.schema.yml
@@ -14,6 +14,9 @@ views.row.fields:
+    add_active_class:

+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1161,6 +1161,11 @@ public function advancedRender(ResultRow $values) {
+          if (!empty($this->view->rowPlugin->options['add_active_class']) && is_array($item['rendered']) && !empty($item['rendered']['#url'])) {
+            $item['rendered']['#url']->setOptions(['set_active_class' => TRUE]);

@@ -1390,6 +1395,7 @@ protected function renderAsLink($alter, $text, $tokens) {
+      'set_active_class' => !empty($this->view->rowPlugin->options['add_active_class']),

I think better to unify more - use the same name "set_active_class" for property

manuel garcia’s picture

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

francoud’s picture

Well at the moment Views (D. 8.6.13) Views still doesn't add the "active" class.
The patch is still not applied.... Am I missing something...?

manuel garcia’s picture

@francoud the patch is not applied to core yet is because (as of now):

  • It is missing test coverage for the new feature.
  • It needs an upgrade path to update existing views on sites.
  • It needs an upgrade path test to verify it works.
  • #69 needs to be addressed.

After that and if there are no more concerns raised up by anyone, it can (hopefully) be marked as Reviewed & tested by the community at which point the core commiters will have a look at it, review it and if deemed acceptable, commit it.

francoud’s picture

Thanks Manuel Garcia.

olafski’s picture

Not tested systematically but patch #67 works for me on a Drupal 8.7.1 site.

plach’s picture

StatusFileSize
new3.4 KB
new3.89 KB

This addresses #69 and slightly tweaks the UI copy.

catch’s picture

+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -57,6 +58,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+      '#description' => $this->t('If checked, if the fields link to the current page, an "is-active" class will be added on active links. WARNING: This feature limits the caching possibilities of this view and should only be enabled when needed.'),

Is this actually true any more? The active class for links is set by misc/active-link.js. It does add some extra markup to the page though for that js, in https://api.drupal.org/api/drupal/core%21includes%21theme.inc/function/t...

aaronbauman’s picture

StatusFileSize
new3.29 KB
new828 bytes

Is this actually true any more? The active class for links is set by misc/active-link.js.

Are you asking whether the "WARNING" bit is still true?
I believe this is no longer applicable and should be removed.
Enabling "set_active_class" adds some overhead in LinkGenerator, but the rendered content should be totally cacheable since the class assignment is handled in javascript. IMO the additional processing cost is not worth mentioning in Views UI.

Attached patch updates the message.

manuel garcia’s picture

Issue summary: View changes

Happy to see progress on this!

I've updated the issue summary with the current status, etc.

timme77’s picture

Patch in #78 works for me. Drupal 8.7.7

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.

opi’s picture

Patch in #78 works fine on Drupal 8.8.1

andypost’s picture

StatusFileSize
new1.13 KB
new3.33 KB

Clean-up implementation a bit but still needs tests and upgrades

andypost’s picture

StatusFileSize
new871 bytes
new3.33 KB

Further clean-up

opi’s picture

Latest patch in #84 works fine on Drupal 8.8.1, thanks for the update @andypost.

timme77’s picture

I don't understand why the community doesn't include this in the core? Is there a way I can make it so that I don't have to apply the patch every time I update the Drupal 8 core?

Thx

aaronbauman’s picture

@timme77 making changes to core takes significant time and effort.
the patch is on its way in to core, with several tasks remaining:

  1. Write the patch
  2. Review it
  3. Add test coverage for the new feature.
  4. Write upgrade path to update existing views on sites.
  5. Write upgrade path test to verify it works.

Belive me, it's frustrating for everyone to have to wait so long on what seem like minor changes like this.
The sooner you or other volunteers can help out with these, the sooner the patch will land in core.

manuel garcia’s picture

StatusFileSize
new7.81 KB
new11.12 KB

I decided to have a go at the upgrade path & upgrade path test

I'm getting a schema error locally, however config_inspector does not seem to find any errors...
Schema key views.view.archive:display.default.display_options.row.options.set_active_class failed with: missing schema

Any pointers would be very welcome :)

Status: Needs review » Needs work

The last submitted patch, 88: 2652000-88.patch, failed testing. View results

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new821 bytes
new11.31 KB

OK so the problem was that we only want to update the display configuration if:
- display uses fields
- display uses row options

Hopefully this will come back green now.

manuel garcia’s picture

andypost’s picture

Great progress! The only missing is test

+++ b/core/modules/views/tests/src/Functional/Update/SetActiveClassTest.php
@@ -0,0 +1,46 @@
+    // Check that the new set_active_class has been set.
+    $this->assertTrue(isset($display['display_options']['row']['options']['set_active_class']));
+    $this->assertSame(FALSE, $display['display_options']['row']['options']['set_active_class']);

it may add a path to view to make sure that attribute is set in HTML

manuel garcia’s picture

StatusFileSize
new11.33 KB

Thanks @andypost for the suggestion about the test, makes sense.

Rerolled #90, three-way merge did the trick:

Checking patch core/modules/views/config/schema/views.row.schema.yml...
Checking patch core/modules/views/src/Plugin/views/field/FieldPluginBase.php...
error: while searching for:
      $tokens = NULL;
      if ($this instanceof MultiItemsFieldHandlerInterface) {
        $items = [];
        foreach ($raw_items as $count => $item) {
          $value = $this->render_item($count, $item);
          if (is_array($value)) {
            $value = (string) $this->getRenderer()->render($value);

error: patch failed: core/modules/views/src/Plugin/views/field/FieldPluginBase.php:1164
Falling back to three-way merge...
Applied patch to 'core/modules/views/src/Plugin/views/field/FieldPluginBase.php' cleanly.
Checking patch core/modules/views/src/Plugin/views/row/Fields.php...
Checking patch core/modules/views/tests/fixtures/update/set-active-class.php...
Checking patch core/modules/views/tests/fixtures/update/views.view.test_set_active_class.yml...
Checking patch core/modules/views/tests/src/Functional/Update/SetActiveClassTest.php...
Checking patch core/modules/views/views.post_update.php...
Applied patch core/modules/views/config/schema/views.row.schema.yml cleanly.
Applied patch core/modules/views/src/Plugin/views/field/FieldPluginBase.php cleanly.
Applied patch core/modules/views/src/Plugin/views/row/Fields.php cleanly.
Applied patch core/modules/views/tests/fixtures/update/set-active-class.php cleanly.
Applied patch core/modules/views/tests/fixtures/update/views.view.test_set_active_class.yml cleanly.
Applied patch core/modules/views/tests/src/Functional/Update/SetActiveClassTest.php cleanly.
Applied patch core/modules/views/views.post_update.php cleanly.
manuel garcia’s picture

Issue tags: -Needs tests
StatusFileSize
new8.62 KB
new13.85 KB

Adding coverage for the functionality itself.

I went with just adding it to the upgrade path test itself, to save the bot some time (and money). Let me know if we should move it to its own functional test instead.

andypost’s picture

Active link class library has own functional tests, so here we just need to be sure that class is set and library attached, imo that's should be enough

manuel garcia’s picture

StatusFileSize
new13.86 KB
new5.02 KB

Patch #94 came out wrong due to incorrect git diff config on my end.

Here's the correct patch and the diff between them in case someone's curious.

manuel garcia’s picture

Re #95:

Active link class library has own functional tests, so here we just need to be sure that class is set and library attached, imo that's should be enough

AFIK there is no need to check for the core/drupal.active-link library itself, as far as I can tell it is always added for authenticated users no matter what: https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/system...

I believe it doesn't hurt to have the extra coverage for when the current page is not the the page of the link and thus should not have the active link, so I'm leaving it in place :)

lendude’s picture

Status: Needs review » Needs work

I went with just adding it to the upgrade path test itself, to save the bot some time (and money). Let me know if we should move it to its own functional test instead.

I like your thinking, but unfortunately it needs its own test. Update tests are removed when we remove the update itself (D10 probably) which would mean we would lose the coverage then.

+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -57,6 +58,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+      '#title' => $this->t('Set the active class on links'),

hmmm the wording of the title makes it look like this would always be added. The description clarifies this, but we all know people don't read the UI, so can we clarify the title to make it clear this is added conditionally? Maybe just 'Set the active class on links to the current page', dunno, something like that.

The rest looks great !

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new12.48 KB
new20.39 KB

Thanks @Lendude for the review!

Changing the option title here as suggested, I agree this clearer.

Also moving the functional test to its own actual functional test, and added a bit of coverage for the option in the views UI itself for good measure.

lendude’s picture

Dove into this a little more, so more things I see:

+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -57,6 +58,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
+      '#description' => $this->t('If checked, if the fields link to the current page, an "is-active" class will be added on active links.'),

Sorry I missed this the first time around but this sentence is a bit wonky. How about:
'When checked an "is-active" class will be added to all fields that are rendered as links that reference the current page.'
Hmm something like that.

+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1163,7 +1163,13 @@ public function advancedRender(ResultRow $values) {
+            $item['rendered']['#url']->setOption('set_active_class', TRUE);

@@ -1393,6 +1399,7 @@ protected function renderAsLink($alter, $text, $tokens) {
+      'set_active_class' => !empty($this->view->rowPlugin->options['set_active_class']),

We add the toggle for 'set_active_class' in two spots, but we are only testing one as far as I can see. So one lacks test coverage.

And then there is #13 which has not been addressed. I agree with @dawehner that the row settings are not a very logical place to add this option. If we feel that this IS the right place for this can we get some motivation as to why that would be? The setting isn't used in the row, it used at a field level.

manuel garcia’s picture

StatusFileSize
new20.46 KB

Thanks again @Lendude for following up on this :)

First, the latest patch needed reroll due to #2989745: views_update_8500() inlines configuration changes instead of this being done on config save for bc

manuel garcia’s picture

StatusFileSize
new46.35 KB
new58.35 KB

Re #13 I think that makes sense, and also makes this feature more granular which is nice. I have moved it in this patch, which required adjusting the schema, update path and tests.

Also took the time to make use of the new ViewsConfigUpdater class on the update path.

The interdiff is very large mainly because I've updated core's default views (hopefully I didn’t miss any).

manuel garcia’s picture

StatusFileSize
new54.97 KB

Sorry git diff is getting confused and generating strange patches. I regenerated the patch on #102 using git diff -C95% and the new test views added should be easier to review.

lendude’s picture

Status: Needs review » Needs work

@Manuel Garcia nice! Much more logical. Rewrite looks great.

The only real thing I'm concerned about is the placement. It is in prime real estate right now. I think it would be better to fold this into the 'rewrite results' fieldset, or maybe one of the others, but that one makes the most sense to me. Thoughts?

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new23.37 KB
new1.54 KB
new58.38 KB

Thanks @Lendude for the review. I agree we should move it, I gave this some thought, and I believe the place to put this option is under Style settings. Since that is what CSS classes are used for, to me it makes sense to put it there. Doing so in this patch.

Views style settings options

manuel garcia’s picture

StatusFileSize
new54.99 KB

grr again git with the weird diffs, using git diff -C95% for this one, interdiff on #105 is ok. Appologies..

lendude’s picture

Status: Needs review » Reviewed & tested by the community

I'm happy, lets see what others think

manuel garcia’s picture

Issue summary: View changes

Thanks @Lendude - just updating the issue summary a bit.

dww’s picture

Status: Reviewed & tested by the community » Needs work

Mostly looks great, thanks! Big patch, but the actual change is quite small.

However, I've got a few nits / concerns before this is committed:

  1. +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
    @@ -706,6 +708,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    +      '#description' => $this->t('If checked, if the field links to the current page, an "is-active" class will be added on active links.'),
    

    This description is rather clumsy:

    A) The double "if X, if Y" at the start is a bit weird.

    B) "Checked" seems potentially confusing.

    C) "... will be added on active links." is weird. I thought we already qualified what links would see a change with "if the field links to the current page"...

    How about:

    'If the field links to the current page, an "is-active" class will be added if this option is enabled.'

    Or something?

  2. +++ b/core/modules/views/src/ViewsConfigUpdater.php
    @@ -273,6 +276,21 @@ public function needsMultivalueBaseFieldUpdate(ViewEntityInterface $view) {
    +   * Sets default value for field set active class option.
    

    Maybe "set_active_class option" instead? With just spaces, it's a bit clumsy to parse.

  3. +++ b/core/modules/views/src/ViewsConfigUpdater.php
    @@ -391,6 +409,30 @@ protected function processMultivalueBaseFieldHandler(array &$handler, $handler_t
    +   * Processes field set active class defaults.
    

    And here... "Processes field set_active_class defaults."

  4. +++ b/core/modules/views/tests/fixtures/update/views.view.test_set_active_class.yml
    @@ -0,0 +1,183 @@
    +label: 'Test block set active class'
    ...
    +      title: 'Test block set active class'
    

    A) What's "block" got to do with it? ;)

    B) "set_active_class" again here?

  5. +++ b/core/modules/views/tests/fixtures/update/views.view.test_set_active_class.yml
    @@ -0,0 +1,183 @@
    +      sorts:
    +        created:
    +          id: created
    +          table: node_field_data
    +          field: created
    +          order: DESC
    +          entity_type: node
    +          entity_field: created
    +          plugin_id: date
    +          relationship: none
    +          group_type: group
    +          admin_label: ''
    +          exposed: false
    +          expose:
    +            label: ''
    +          granularity: second
    

    Why do we care about sorts for this fixture?

  6. +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_set_active_class.yml
    @@ -0,0 +1,183 @@
    +label: 'Test block set active class'
    

    And here?

  7. +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_set_active_class.yml
    @@ -0,0 +1,183 @@
    +      sorts:
    +        created:
    +          id: created
    +          table: node_field_data
    +          field: created
    +          order: DESC
    +          entity_type: node
    +          entity_field: created
    +          plugin_id: date
    +          relationship: none
    +          group_type: group
    +          admin_label: ''
    +          exposed: false
    +          expose:
    +            label: ''
    +          granularity: second
    

    Don't think the test is going to care about sorts, either. Generally, I'm in favor of less moving parts in any given test. If a test doesn't care, don't include that Views feature. Views tests are already complicated and bloated enough. ;)

  8. +++ b/core/modules/views/tests/src/Functional/Update/SetActiveClassTest.php
    @@ -0,0 +1,50 @@
    +    // Assert no fields in the test view have the set active class option set.
    

    set_active_class

  9. +++ b/core/modules/views/tests/src/Functional/Update/SetActiveClassTest.php
    @@ -0,0 +1,50 @@
    +      $this->assertTrue(isset($field['set_active_class']));
    

    $this->assertArrayHasKey('set_active_class', $field);

  10. +++ b/core/modules/views/tests/src/Functional/Update/SetActiveClassTest.php
    @@ -0,0 +1,50 @@
    +      $this->assertSame(FALSE, $field['set_active_class']);
    

    $this->assertFalse($field['set_active_class');

  11. +++ b/core/modules/views/tests/src/Functional/ViewsSetActiveClassTest.php
    @@ -0,0 +1,90 @@
    +    // Enable the Set the active class on links to the current page option in
    +    // the view.
    

    Enable the set_active_class option in the view.

Thanks!
-Derek

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.

aleevas’s picture

Status: Needs work » Needs review
StatusFileSize
new54.32 KB
new20.31 KB

@dww thanks for your review.
I've added all your warnings and re-rolled the patch against 9.1 branch

aleevas’s picture

StatusFileSize
new18.66 KB
new54.32 KB

Sorry, was added a wrong interdiff.
Also I've made the patch for 8.9 branch with fixes

The last submitted patch, 111: 2652000-9.1-111.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 112: 2652000-8.9-111.patch, failed testing. View results

aleevas’s picture

Status: Needs work » Needs review
StatusFileSize
new54.3 KB
new54.3 KB
new1.79 KB

Trying to fix the failed tests.
The Interdiff the same for both patches

Status: Needs review » Needs work

The last submitted patch, 115: 2652000-9.1-115.patch, failed testing. View results

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new54.1 KB
new2.18 KB

First, thank you @dww for the review, all good points.
Also, thank you @aleevas for moving this forward.

I reviewed the changes since #106 and they look good to me. I attach an interdiff which includes all changes since then for easier review.

I noticed that the change in #109.11 were not quite right so fixing that here. The rest of points on #109 were addressed correctly.

Fixing the failing test here as well (hopefully)

manuel garcia’s picture

StatusFileSize
new7.48 KB

Oops forgot the interdiff I talked about in #117...

dww’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the fixes, @Manuel Garcia and @aleevas!

This is all I can find in #117 to complain about:

+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1164,7 +1174,13 @@ public function advancedRender(ResultRow $values) {
+          // Setting the active class on a link is now an opt-in feature, so
+          // we need to check if the feature is activated for this field.

"we" would fit on the previous line. ;)

Definitely not worth re-rolling just for that, so I'm going to RTBC. But if anyone finds anything else that needs fixing, we could fix this, too.

Thanks again!
-Derek

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record
  1. This needs a change record to document the new functionality and the views changes.
  2. +++ b/core/modules/views/src/ViewsConfigUpdater.php
    @@ -455,6 +473,30 @@ protected function processMultivalueBaseFieldHandler(array &$handler, $handler_t
    +      if (!isset($handler['set_active_class'])) {
    +        $handler['set_active_class'] = FALSE;
    +        $changed = TRUE;
    +      }
    

    We need to trigger an E_USER_DEPRECATION error here. Something similar to:
    @trigger_error(sprintf('The entity link url update for the "%s" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2857891.', $view->id()), E_USER_DEPRECATED);

    And this message should be tested by the legacy test.

  3. I think we should \Drupal\Tests\views\Kernel\ViewsConfigUpdaterTest too.
ramya balasubramanian’s picture

Assigned: Unassigned » ramya balasubramanian
ramya balasubramanian’s picture

Assigned: ramya balasubramanian » Unassigned
Status: Needs work » Needs review
StatusFileSize
new56.28 KB
new2.58 KB

Hi @alexpott,
I have addressed your above comments. Please have a look and let me know if there are any issues.

ramya balasubramanian’s picture

Hi @alexpott,
Since my previous patch test cases are failed, I am reuploading the patch with some changes. Please have a look.

Status: Needs review » Needs work

The last submitted patch, 123: views-do-not-have-active-class-anymore-2652000-123.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ramya balasubramanian’s picture

Status: Needs work » Needs review
StatusFileSize
new60.5 KB
new761 bytes

Fixing these test cases. Uploading the patch again.

ramya balasubramanian’s picture

Found some parameters are missing. Uploaded the patch again.

Status: Needs review » Needs work

The last submitted patch, 126: views-do-not-have-active-classes-anymore-2652000-126.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ramya balasubramanian’s picture

Status: Needs work » Needs review
StatusFileSize
new60.52 KB
new1.4 KB

Please have a look at this patch.

Status: Needs review » Needs work

The last submitted patch, 128: views-do-not-have-active-classes-2652000-127.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

alexpott’s picture

I think the number of deprecations here should make us step back and have a think. I have a couple of thoughts:

  • Is this really the correct level for this setting to go on? Would it make more sense to be part of \Drupal\views\Plugin\views\field\LinkBase - then we’d have far fewer handlers to deal with. On the other hand FieldPluginBase has the make link setting so … hmmm tricky.
  • Is it worth considering allowing set_active_class to be omitted from config and therefore not exported to config if it is equal to false. That way none of the configuration change would be necessary. However, doing this comes with the downside of an exported view not having all the settings - so if the default value were to change then all existing views would change.
markusd1984’s picture

Could this work/be made available for D7 as well?

I have the problem that many fields don't have the "active" class and thus hover effect styling is not possible
and therefore have to manually add this to each field every time (via style settings > customize field html > create a css class > "active").

c-logemann’s picture

@markusd1984 This core issue is about loosing this possibility with views integration in D8 core. Now we have already D9 core stable and this is still not included. The better place to start is the Issue Queue of D7 Views Module. Maybe there is already an existing issue and hopefully a working patch for you. If not you can always open a new issue there.

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.

gaëlg’s picture

StatusFileSize
new55.22 KB
new55.24 KB

Here's a try to reroll #128.

manuel garcia’s picture

Status: Needs work » Needs review
gauravvvv’s picture

StatusFileSize
new59.07 KB
new969 bytes

Fixed PHPCS error for #136-9.3, Attached interdiff for same. Please review.

ranjith_kumar_k_u’s picture

StatusFileSize
new54.99 KB
new718 bytes

Status: Needs review » Needs work

The last submitted patch, 139: 2652000-139.patch, failed testing. View results

ryan-l-robinson’s picture

Following this thread. I'd love to see this incorporated into core as it is currently an issue for our site trying to style active links generated by a view.

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

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

prudloff’s picture

StatusFileSize
new55.11 KB

Here is a reroll of #139 for Drupal 9.4.1.

sauravkashyap’s picture

StatusFileSize
new54.1 KB

please review my work

sauravkashyap’s picture

StatusFileSize
new54.1 KB

please review my work

avpaderno’s picture

Status: Needs work » Needs review

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nod_’s picture

Status: Needs review » Needs work
Issue tags: +Needs careful reroll

Patch or MR doesn't apply anymore
The last patch or MR doesn't apply to the target branch, please reroll the code so that it can be reviewed by the automated testbot.

D10 version needed
At this time we would need a D10.1.x patch or MR for this issue.

careful reroll
The patch can be tricky to reroll and some code might get lost in the process. When rerolling this issue please make sure all the parts of the patch are kept (new files, new tests, all the changes to the different parts of the file, changes to es6 files ported to .js files, etc.)

jmsomera’s picture

Status: Needs work » Needs review
StatusFileSize
new55.12 KB

Here is a reroll of #143 for Drupal 9.4.10.

avpaderno’s picture

Status: Needs review » Needs work
_pratik_’s picture

Status: Needs work » Needs review
StatusFileSize
new36.27 KB

Reroll for 10.1.x
Please review
Thanks

Status: Needs review » Needs work

The last submitted patch, 151: 2652000-151.patch, failed testing. View results

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gabriel.passarelli’s picture

Patch #151 worked for me:
Drupal: 10.1.1
PHP: 8.1.14

Before Patch

Views Configuration
Views Configuration

HTML
HTML with is-active class applied

After Patch

Views Configuration
Views Configuration
HTML with config enabled
HTML with is-active class applied
HTML with config disabled
HTML with is-active class not applied

jwilson3’s picture

It is not entirely clear why the last patch in #151 failed because the Drupal CI job output is miles long. This needs to be converted to an MR, with "careful reroll" as pointed out in the issue tags, to get things over to GitLab CI.

mrinalini9 made their first commit to this issue’s fork.

dmundra’s picture

StatusFileSize
new37.94 KB

Creating a patch file from the MR and uploading it here.

dmundra’s picture

StatusFileSize
new38.01 KB

Here is a patch just for 10.4

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.