Problem/Motivation

The Taxonomy Term List shows terms in unexpected order when re-ordering following a reset to alphabetical order.

Steps to reproduce

Scenario 1

  1. Do a standard install
  2. Log in as admin
  3. Add the following tags in this order: Bravo 1, Alpha 2, Delta 3, Charlie 4. (These are the terms the new tests use.)
  4. Navigate to the list of tags. You should see them ordered as: Alpha 2, Bravo 1, Charlie 4, Delta 3.
  5. Drag Charlie 4 up so it is the second term in the list and Save.
  6. The list of tags should be ordered as: Alpha 2, Charlie 4, Bravo 1, Delta 3.
  7. Click reset to alphabetical and confirm.
  8. The list of tags should be: Alpha 2, Bravo 1, Charlie 4, Delta 3.
  9. Drag Charlie 4 up so it is the second term in the list and Save.
  10. The list of tags is expected to be ordered as: Alpha 2, Charlie 4, Bravo 1, Delta 3... but they are not ordered as expected.

If you clear cache and refresh the page after step 8 above, then the ordering in the last step is as would be expected.

Scenario 2, steps to reproduce

  1. Clear cache
  2. Go to tags list, /admin/structure/taxonomy/manage/tags/overview
  3. Drag Charlie 4 up so it is the second term in the list and Save.
  4. The list of tags should be ordered as: Alpha 2, Charlie 4, Bravo 1, Delta 3.
  5. Click Show row weights and confirm that row weights are in order 0, 1, 2, 3 (without the patch, the order may be wrong and you may need to clear caches)
  6. Add a view of Tags taxonomy (create a page) -- Add field Term ID, Add field Weight, Sort by Weight (asc), Save
  7. Go to to view page that you just created, confirm terms are sorted by weight
  8. Go to tags list, /admin/structure/taxonomy/manage/tags/overview
  9. Click Reset to alpha and confirm.
  10. The list of tags should be: Alpha 2, Bravo 1, Charlie 4, Delta 3.
  11. Go to to view page, reload
  12. Confirm order did not update as expected (not alpha, still sorted by weight)

As in Scenario 1, clearing cache and refreshing the page will correctly display term weight as 0. For the view, terms will be ordered by TID as that is the fallback default sort for views. Scenario 2 is fixed with the addition of `Cache::invalidateTags($term_ids);` that was added in #63.

Proposed resolution

Clear cache as part of resetting to alphabetical order.

Currently there's a function that does a straight-up database query to update weights, with no caches being cleared or invalidated.

Remaining tasks

  1. Test patch</li>
  2. What cache tags are cleared when a taxonomy term save happens? And are we clearing those tags here? See #49
  3. Should we also invalidate the ENTITY_TYPE_list and ENTITY_TYPE_list:BUNDLE cache tags? See #76
  4. Is the extra Cache invalidation necessary or is the resetCache faulty? See duplicate ticket #44
  5. Review

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

CommentFileSizeAuthor
#112 2928661-112.patch1.13 KBronchica
#96 2928661-96-MR9067-10.3.x.diff28.72 KBkriboogh
#96 2928661-96-MR9044-11.x.diff28.68 KBkriboogh
#74 interdiff_72_74.txt1.15 KBameymudras
#74 2928661-74.patch24.88 KBameymudras
#72 interdiff_2928661_71-72.txt511 bytes_pratik_
#72 2928661-72.patch24.94 KB_pratik_
#71 interdiff_2928661-68-71.txt1.02 KB_pratik_
#71 2928661-71.patch24.94 KB_pratik_
#70 interdiff_2928661-68-70.txt20.29 KB_pratik_
#70 2928661-70.patch5.14 KB_pratik_
#68 2928661-68.patch24.8 KBdjsagar
#68 interdiff_64-68.txt1.11 KBdjsagar
#64 2928661-64-reordering-taxonomy-terms.patch24.76 KBcapysara
#63 2928661-63-reordering-taxonomy-terms.patch24.82 KBcapysara
#48 After_patch.mp45.47 MBdeepalij
#48 Before_patch.mp49.11 MBdeepalij
#30 interdiff_30FAIL-30.txt818 bytesdanflanagan8
#30 2928661--30.patch14.33 KBdanflanagan8
#30 2928661--30--FAIL.patch13.53 KBdanflanagan8
#27 2928661--27--FAIL.patch12.3 KBdanflanagan8
#25 2928661--25--FAIL.patch6.94 KBdanflanagan8
#18 2928661-18-dont-resort-reset-order.patch1.38 KBalexrayu
#16 taxonomy-term-sort.png.png67.87 KBsarguna raj m
#15 taxonomy-term-sort.png15.69 KBsarguna raj m
#13 taxonomy-sort-weight-admin-form-submit-fix-2928661-13.patch1.84 KBd34dman
#12 clicked-save.png85.97 KBsarguna raj m
#12 reset-to-alphabetical.png77.23 KBsarguna raj m
#9 taxonomy-sort-weight-admin-form-submit-fix-2928661-09.patch1.72 KBd34dman
#7 taxonomy-sorting-2928661-7.patch554 bytesdaveferrara1
#5 taxonomy-warning-message.png104.13 KBsarguna raj m
#2 taxonomy-sorting-2928661-2.patch555 bytesdaveferrara1

Issue fork drupal-2928661

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

daveferrara1 created an issue. See original summary.

daveferrara1’s picture

StatusFileSize
new555 bytes

Here is a patch that fixes the issue for me when uasort() is called on the current form state.

daveferrara1’s picture

Status: Active » Needs review
sarguna raj m’s picture

Assigned: Unassigned » sarguna raj m
sarguna raj m’s picture

Status: Needs review » Needs work
StatusFileSize
new104.13 KB

Hi daveferrara1,

I have tested the patch #2 manually and it seems to be working fine.

But a warning message occurs when we click the save button.
Warning Message: Warning: uasort() expects parameter 1 to be array, null given in taxonomy_overview_terms_submit() (line 449 of /var/www/html/drupal-contribution/modules/taxonomy/taxonomy.admin.inc).

Test case :
Created a new taxonomy term and tried to drag and sort some taxonomy terms and saved it. Then listed the terms in alphabetical order. After clicking save button previous sort appeared. After applying the patch it works fine. But warning message appears. When ever we are clicking the save button the warning message appears.

Please refer the attached screenshots.

sarguna raj m’s picture

Assigned: sarguna raj m » Unassigned
daveferrara1’s picture

StatusFileSize
new554 bytes

Looks like that first patch only worked for me because the key doesn't exist. Here is an updated patch using the proper key and the warning is cleared.

d34dman’s picture

I have debugged this issue, and found out what is causing the problem.

When the terms are reset to alphabetically, what taxonomy module does is, it resets all their weights to '0'. The actual alphabetical order is hardcoded into to taxonomy module.

Since all of the terms contain "0" as their weight, when uasort is used with drupal_sort_weight, the order returned by uasort is not predictable (but consistent it seems).

d34dman’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new1.72 KB

Attaching a patch that would use a custom sort function. This will use drupal_sort_weight when weight is supplied, otherwise will try to use the taxonomy "name" to sort.

d34dman’s picture

Version: 7.56 » 7.x-dev

Patch is applied to 7.x-dev.

After applying the patch, you may review this patch as follows,

1. Create a new vocabulary called TEST
2. Add 5 terms called A, B, C, D, and E.
3. In the Taxonomy overview interface, i.e. the place where the terms are listed in a table, show the row weights too. This will help a lot in understanding what is going on behind the scenes.
4. Follow the procedure that is listed in the main issue description and you can confirm the order is maintained after last save operation.

sarguna raj m’s picture

Assigned: Unassigned » sarguna raj m
sarguna raj m’s picture

Assigned: sarguna raj m » Unassigned
Status: Needs review » Needs work
StatusFileSize
new77.23 KB
new85.97 KB

Hi D34dMan,

I have tested the patch #9 manually. There is an issue after clicking the save button.

I have created the taxonomy terms with upper and lower case.
When clicking Reset to alphabetical button, the terms are set to alphabetical order but again after clicking the Save button alphabetical order changes like upper cases are sorted first and then the lower cases.

Please refer the attached screenshots.

d34dman’s picture

StatusFileSize
new1.84 KB

Nice catch @sarguna raj.

I have modified the taxonomy_sort_weight function to use case insensitive comparison, and if the strings are equal, then use tid to sort them. Hopefully this is as close to the database OrderBy statement.

sarguna raj m’s picture

Assigned: Unassigned » sarguna raj m
Status: Needs work » Needs review

Changing the status to Needs review.

sarguna raj m’s picture

Assigned: sarguna raj m » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new15.69 KB

@D34dMan

I have tested the patch #13 and everything works fine related to the taxonomy.
Tested the above issues and also the taxonomy terms with integer value.

Please refer the attached screenshots.

sarguna raj m’s picture

StatusFileSize
new67.87 KB

Kindly find the updated attached screenshot.

attheshow’s picture

Version: 7.x-dev » 8.6.x-dev
Status: Reviewed & tested by the community » Active

There seems to be a very similar issue in Drupal 8.6.0-rc1. After doing a reset to alphabetical, it's very difficult to manually sort the terms in a list. They keep reordering in a seemingly random fashion for multiple submits of the form. The only way I've found to clearly fix it through the UI is to use the the Show Row Weights button and adjust them manually to the sort order that you're trying to accomplish.

alexrayu’s picture

StatusFileSize
new1.38 KB

Probably would be logical to detect a reset and skip sorting. Please review a proposed patch that we are using to address the issue on our systems.

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

joachim’s picture

Status: Active » Needs work
Issue tags: -taxonomy, -sort +Needs tests
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -510,7 +510,10 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
+    if (!$this->isOrderReset($terms)) {

What is this detecting?

If it's trying to figure out if the alphabetical sort button has just been pressed to submit the form, then we should check the form state.

If this is for a later form submission, then why does alphabetical sorting set all the weights to zero?

joachim’s picture

Ok, so weights at 0 is the default when new terms are created.

So everything in the DB is correct, and this is a form data problem.

avpaderno’s picture

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

On Drupal 8.9.x, only security issues are fixed.

danflanagan8’s picture

The tests are really lacking for the term re-ordering form. The test TermTest:testTermReorder() incorrectly assumes that the three test terms are named term1, term2, and term3.

// Fetch the created terms in the default alphabetical order, i.e. term1
// precedes term2 alphabetically, and term2 precedes term3.

The three test terms in fact have randomly generated theme names. So none of the assertions in that test related to alphabetizing are especially meaningful. The test terms should have hardcoded names to make alphabetization tested more clearly. (Update: I think I understand that comment now. term1 does not necessarily correspond to tid = 1. But the clarity is lacking unless there are hardcoded names that can clearly be alphabetized. We also shouldn't depend on the fetch returning terms in alphabetical if we don't have to.)

And according to @attheshow in #17,

The only way I've found to clearly fix it through the UI is to use the the Show Row Weights button and adjust them manually to the sort order that you're trying to accomplish.

The TermTest:testTermReorder() test doesn't drag terms; it submits explicit weights. I think that whatever test we write for this should actually drag the terms. That might require a FunctionalJavascript test.

danflanagan8’s picture

Status: Needs work » Needs review
StatusFileSize
new6.94 KB

Here's an attempt add adding clearer test coverage for dragging terms around the overview page. The test does this:

  1. Make a vocab
  2. Make some terms
  3. Drag the terms around and save
  4. Reset to alphabetical order and confirm
  5. Click save without dragging anything

And then for some reason the terms are out of order!

I think it would be worth adding additional steps that confirm the form can do nesting and then reorder after nesting and stuff like that, but that may beyond the scope of this issue. I'm not sure what the process is for adding missing test coverage in cases where there isn't a bug directly associated with the missing coverage. But I am of the mind that TermTest:testTermReorder() as it stands is insufficient coverage for the overview form. Even the comment is a copy-paste typo from the preceding test!

/**
  * Save, edit and delete a term using the user interface.
  */

The overview form testing needs some love.

Status: Needs review » Needs work

The last submitted patch, 25: 2928661--25--FAIL.patch, failed testing. View results

danflanagan8’s picture

Status: Needs work » Needs review
StatusFileSize
new12.3 KB

I realized that I mixed up expected/actual values in that test. I'm posting a new patch where I fix that error. I also added a test class that nests terms by dragging and moves them around and alphabetizes.

Once again, I don't know if adding these tests is overkill for this particular issue, but I think we need to get tests like this into the codebase somehow.

Status: Needs review » Needs work

The last submitted patch, 27: 2928661--27--FAIL.patch, failed testing. View results

d34dman’s picture

Ok, so weights at 0 is the default when new terms are created.
So everything in the DB is correct, and this is a form data problem.

Agreed, it is a form data problem. A form data problem, where the form doesn't render the terms based on how taxonomy_get_tree/TermStorage::loadTree method defines the order to be like.

More info:

Point to be noted is that, the user's intend is respected. Which means, even thought the taxonomy form shows the term in broken order, the taxonomy_get_tree/TermStorage::loadTree will load the terms in correct order.

The taxonomy_get_tree and TermStorage::loadTree methods uses the following query to sort by weight,

      ->orderBy('t.weight')
      ->orderBy('t.name')
      ->execute();

From the above SQL query, it is clear that, if all the terms have same weight, then they are ordered by "name" column (adhering to SQL ordering rules in case multiple terms of same name exists).

This is interesting, because, reliance on render array, which uses "#weight" drupal_sort_weight or SortArray::sortByWeightProperty alone is not sufficient in determining the order. And hence we have a buggy experience when terms have same weight.

danflanagan8’s picture

Status: Needs work » Needs review
StatusFileSize
new13.53 KB
new14.33 KB
new818 bytes

I think I have a fix for the issue. The taxonomy storage cache does not get reset after alphabetizing. The TermStorage::resetWeights() does a straight-up db operation so there's no cache invalidation of any kind from that. I just added a cache reset to the alphabetize form. Maybe it should be part of the TermStorage::resetWeights() function, but I don't think that's called anywhere else so it doesn't matter much.

I also bulked up the fail test once a gain to demonstrate that after alphabetizing, the form reloads in the right order visually but with the wrong weights set.

The last submitted patch, 30: 2928661--30--FAIL.patch, failed testing. View results

danflanagan8’s picture

Issue tags: -Needs tests

Removing "Needs tests"

avpaderno’s picture

The issue summary should be updated. The description of the bug and the steps to reproduce it can be improved.

danflanagan8’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

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

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should 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.

wells’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #30 applies to Drupal 9.3.x and resolves the issue as described. Tests have been added and enhanced. The summary is up-to-date and accurate. Marking RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 30: 2928661--30.patch, failed testing. View results

yogeshmpawar’s picture

Status: Needs work » Reviewed & tested by the community

Setting back to RTBC. Looks like test failures are unrelated.

xjm’s picture

Title: Taxonomy Term List Save Resorting » Reordering taxonomy terms after "Reset to alphabetical" yields incorrect results upon save

 

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 30: 2928661--30.patch, failed testing. View results

danflanagan8’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated random fail. Resetting status.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 30: 2928661--30.patch, failed testing. View results

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +Bug Smash Initiative

Putting back to RTBC seems random failures

quietone’s picture

Status: Reviewed & tested by the community » Needs work

This is retesting on a 9.2. Can someone get it testing on 9.5 and/or 10?

Thanks

smustgrave’s picture

Status: Needs work » Needs review

@quietone the patch #30 still applies to 9.5

deepalij’s picture

Assigned: Unassigned » deepalij
deepalij’s picture

Assigned: deepalij » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new9.11 MB
new5.47 MB

As the test passed for 9.5.x, verified patch #30 on 9.5.x.
The patch was applied successfully.

Steps followed:
1. Create vocab
2. Create terms (with upper/lowercase)
3. Drag to the terms > Save
4. Reset to alphabetical order and confirm
5. Save without dragging any term
6. Again drag the term to top > Save
7. Ensure the dragged term is getting saved

It is working fine.
Please find attached the videos.
Can be moved to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I think we need to ensure that the same cache tags are clears as would occur on a taxonomy term save happen and I think to be consistent with term saving this needs to occur inside the \Drupal\taxonomy\TermStorageInterface::resetWeights() implementation - so it doesn't matter where it is called from. The duplicate issue does some of this but not all of this - see #2956594: Taxonomy "Reset to alphabetical" doesn't clear cache of entities. I'm going to close that one as dupe and credit people on that issue here.

alexpott credited catch.

alexpott credited gido.

alexpott credited kriboogh.

alexpott credited Vj.

alexpott credited wengerk.

alexpott’s picture

Crediting wengerk, Mschudders, gido, Vj, kriboogh, Asacolips, tonifisler, alexrayu, borisson_, Krzysztof Domański, catch from the dupe - #2956594: Taxonomy "Reset to alphabetical" doesn't clear cache of entities

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

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should 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.

capysara’s picture

I can reroll this patch, but I want to be sure I understand the last comment.

This needs to occur inside the \Drupal\taxonomy\TermStorageInterface::resetWeights() implementation...
The duplicate issue does some of this but not all of this.

Does that mean that cache tag invalidation should go in /taxonomy/src/TermStorage.php instead of VocabularyResetForm.php? Are there are other pieces that are still missing?

And, should the tests from both issues be combined? Or is one of them better than the other?

capysara’s picture

StatusFileSize
new24.82 KB

Here's a patch in the following comment #64 based on assumptions from my previous comment. (Ignore the patch in this comment.)

I moved the code from the duplicate issue, comment #52 into TermStorage as noted above in this issue, comment #49.
I included tests from both this issue (#30) and the duplicate (#52).

I tested the patch on a fresh 10.0.0 install, using the steps to reproduce in the Issue Summary.
I also tested the patch on 9.5.1-dev using DrupalPod.

capysara’s picture

StatusFileSize
new24.76 KB

Corrected the path in the patch file.

capysara’s picture

joachim’s picture

+++ b/core/modules/taxonomy/src/TermStorage.php
@@ -334,6 +335,20 @@ public function resetWeights($vid) {
+    $termIds = $entityQuery->execute();

Code style: both these should be snake_case

+++ b/core/modules/taxonomy/src/TermStorage.php
@@ -334,6 +335,20 @@ public function resetWeights($vid) {
+      ->accessCheck(TRUE)

Access check should be FALSE.

_utsavsharma’s picture

Status: Needs work » Needs review
djsagar’s picture

StatusFileSize
new1.11 KB
new24.8 KB

Fixed command failures of #64.
Please review.

borisson_’s picture

Status: Needs review » Needs work

No, please fix #66 before asking for a review.

_pratik_’s picture

Status: Needs work » Needs review
StatusFileSize
new5.14 KB
new20.29 KB

Patch #68 updated with requirements in #66.
Thanks

_pratik_’s picture

StatusFileSize
new24.94 KB
new1.02 KB

My bad, ignore #70.
Here is the correct one.

_pratik_’s picture

StatusFileSize
new24.94 KB
new511 bytes

Fixed CCF in #71

Status: Needs review » Needs work

The last submitted patch, 72: 2928661-72.patch, failed testing. View results

ameymudras’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs work » Needs review
StatusFileSize
new24.88 KB
new1.15 KB

I was able to reproduce this issue on 10.1.x using the steps in the summary, the patch provided in #72 worked for me and did fix the issue with the cache.

I have tried to fix the CI issues with the above patch

avpaderno’s picture

Status: Needs review » Needs work
joachim’s picture

+++ b/core/modules/taxonomy/src/TermStorage.php
@@ -338,6 +339,22 @@ public function resetWeights($vid) {
+    $entityTypeKey = $this->getEntityType()->getKey('bundle');

Another variable with the wrong case.

Also, should we also invalidate the ENTITY_TYPE_list and ENTITY_TYPE_list:BUNDLE cache tags?

capysara’s picture

Issue summary: View changes

I opened a merge request to address the snake case comment as noted in #76.

Regarding the question in #76, I don't have the answer or an example of when this would be necessary--if this should also invalidate ENTITY_TYPE_list and ENTITY_TYPE_list:BUNDLE cache tags. Can anyone think of a use case where we'd need this?

I updated the IS to include Steps that demonstrate what Cache::invalidateTags($term_ids); fixes. I also updated the Remaining tasks to include some of the questions in the issue queue that are pending answers.

I'm not sure what the most appropriate status is now. I updated the patch (MR), but should this issue remain Needs Work until the questions are answered?

smustgrave’s picture

Issue summary: View changes
Issue tags: +Needs Review Queue Initiative

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

Removing credit from myself for the rebase, as I was making sure the tests pass. Will let committers decide to add me back or not.

Tested the MR following the steps from the issue summary in scenario 1 and this does seem to solve the problem.

Moving back to NW for the remaining tasks in the issue summary update. If they've been completed could you mark them please.

Thanks and good work!

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.

quietone credited nginex.

quietone’s picture

kriboogh’s picture

MR !3209 is for 10.1
MR !9044 is for 11.x

kriboogh changed the visibility of the branch 10.3.x to hidden.

kriboogh changed the visibility of the branch 11.x to hidden.

kriboogh changed the visibility of the branch 10.1.x to hidden.

kriboogh’s picture

Status: Needs work » Needs review

MR !9067 is for 10.3

kriboogh’s picture

StatusFileSize
new28.68 KB
new28.72 KB

Patches added

smustgrave’s picture

Status: Needs review » Needs work

Left comments on MR

FYI would recommend hiding all non 11.x branches

capysara changed the visibility of the branch 2928661-reordering-taxonomy-terms to hidden.

capysara changed the visibility of the branch capysara-10.1.x-patch-02163 to hidden.

capysara changed the visibility of the branch 11.x to active.

capysara changed the visibility of the branch 11.x to hidden.

capysara changed the visibility of the branch 3056020-meta-content-translation-11.x to hidden.

capysara changed the visibility of the branch 2928661-reordering-taxonomy-terms to active.

capysara changed the visibility of the branch 2928661-reordering-taxonomy-terms-10.3.x to hidden.

capysara’s picture

Status: Needs work » Needs review

Made updates per MR comments.

(Sorry for all the branch visibility toggling.)

smustgrave’s picture

Status: Needs review » Needs work

Thanks for the quick response. Still appears to be a few dozen out of scope spacing changes. Nitpicky stuff but should be reverted.

capysara’s picture

Status: Needs work » Needs review

I removed the rest of the extra spacing.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

https://git.drupalcode.org/issue/drupal-2928661/-/jobs/2418794 shows the test coverage

Applied 1 missing return void.

Believe rest of feedback has been addressed.

quietone’s picture

Status: Reviewed & tested by the community » Needs work

There are several questions in the 'remaining tasks' that I can't find a clear answer to. Can someone check that and either answer them or provide a link to the answer?

I read the MR and mostly concentrated on the comments and noticed two things, one that many are wrapped incorrectly and usages if "Helper to" in a method summary line. The phrase 'Helper to' (which is here and there in core) does not add anything useful to the summary line and it would be better to simply state what the function does. I have changed the MR to wrap the comments correctly and remove use of 'helper ..', plus a few other tweaks in the comments. It was simpler to do that than make many suggestions in the MR.

So, we just need answers to those questions to be sure that everything is covered here.

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.

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

ronchica’s picture

StatusFileSize
new1.13 KB

Our editorial team has a new search view that works with the taxonomy term list order and facets. This issue was making it impossible for them to predictably order the items and have them reflected in the order of the view’s facet filters.

We are running 11.3 and the current state of the patch does not apply due to the tests, so I made a smaller patch with the fix. The fix does to solve our issue.

I am noticing that after the patch is applied, while resetting the terms to alphabetical order works, unless the page is saved, all the term weights are zero. Maybe this is expected behavior, but it is not ideal.

Posting the patch here, in case anyone else experiencing this issue needs a solution before the merge happens.