Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mariusal’s picture

joachim’s picture

Status: Active » Reviewed & tested by the community

Patch works perfectly. Thanks -- just what I was looking for.

joachim’s picture

Title: Taxonomy term handler » Add a taxonomy term weight handler
Status: Reviewed & tested by the community » Needs work

Ah 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.

joachim’s picture

Status: Needs work » Needs review
FileSize
2.19 KB

Updated 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).

iStryker’s picture

Status: Needs review » Reviewed & tested by the community

This 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.

iStryker’s picture

Third solution added today. This solves taxonomy as a separate submodule. See #1916380: Roadmap to add taxonomy support to module for everything

DamienMcKenna’s picture

DamienMcKenna’s picture

Yes, this works perfectly.

abrlam’s picture

Unfortunately, I'm having trouble patching this (keep getting the new blank line at EOF error). Any pointers?
Thanks.

Checking patch draggableviews.info...
error: while searching for:
files[] = handlers/draggableviews_handler_native.inc
files[] = handlers/draggableviews_handler_fieldapi.inc
files[] = handlers/draggableviews_hierarchy_handler_native.inc

dependencies[] = entity

error: patch failed: draggableviews.info:15
error: draggableviews.info: patch does not apply
Checking patch handlers/draggableviews_handler_taxonomy_term.inc...
Taxonomy_term_handler-1716912-1.patch:56: new blank line at EOF.
+
joseph.olstad’s picture

@abrlam

try

cd this_module

wget https://www.drupal.org/files/1716912.draggableviews.taxo-term-weight-handler.patch

patch -p1 < 1716912.draggableviews.taxo-term-weight-handler.patch
abrlam’s picture

Thank you @joseph.olstad. It worked.

NWOM’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.25 KB

It appears the patch no longer works against the newest dev version. Here is a re-roll. Please review.

DamienMcKenna’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

NWOM’s picture

Please 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.

abrlam’s picture

Thank 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.