Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Add support for Taxonomy term's weight.
Comment | File | Size | Author |
---|---|---|---|
#12 | add_taxonomy_weight_handler-1716912-12.patch | 2.25 KB | NWOM |
Comments
Comment #1
mariusal CreditAttribution: mariusal commentedComment #2
joachim CreditAttribution: joachim commentedPatch works perfectly. Thanks -- just what I was looking for.
Comment #3
joachim CreditAttribution: joachim commentedAh just one problem: the handler produces error messages if it can't find $row->taxonomy_term_data_weight, which is only there if there's a field/sort/filter on the view that adds it.
So this patch should add documentation about this.
In the longer run, I think handlers should be able to validate the view, or have a say in adding fields to the view -- but that's for another issue.
Comment #4
joachim CreditAttribution: joachim commentedUpdated patch.
I've added a note of this to the readme and very slightly tidied up the code for coding standards (don't use abbreviations for variable names).
Comment #5
iStryker CreditAttribution: iStryker commentedThis patch works. I love how clean this patch is, however, I wonder if #1851752: Drag handler for saving weight into any column in any base table is the better way to go through. This patch does the same thing, however it uses an entity wrapper. I believe there is more possibilities for it.
Comment #6
iStryker CreditAttribution: iStryker commentedThird solution added today. This solves taxonomy as a separate submodule. See #1916380: Roadmap to add taxonomy support to module for everything
Comment #7
DamienMcKennaComment #8
DamienMcKennaYes, this works perfectly.
Comment #9
abrlam CreditAttribution: abrlam commentedUnfortunately, I'm having trouble patching this (keep getting the new blank line at EOF error). Any pointers?
Thanks.
Comment #10
joseph.olstad@abrlam
try
Comment #11
abrlam CreditAttribution: abrlam commentedThank you @joseph.olstad. It worked.
Comment #12
NWOM CreditAttribution: NWOM commentedIt appears the patch no longer works against the newest dev version. Here is a re-roll. Please review.
Comment #13
DamienMcKennaBack to RTBC.
Comment #14
NWOM CreditAttribution: NWOM commentedPlease take a look at #1916168: Taxonomy Term Weight & Hierarchy support submodule. It appears to be more feature complete and works automatically with taxonomy's native weight and hierarchy.
Comment #15
abrlam CreditAttribution: abrlam commentedThank you @NWOM for re-rolling the patch (#12).
On an unrelated note, if you notice draggableview behaving strangely (drag not releasing, getting tabledrag.js relationship error in the console browser), try removing the taxonomy weight field from the Fields section.