Needs review
Project:
DraggableViews
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2012 at 14:09 UTC
Updated:
14 Feb 2017 at 20:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
istryker commentedThis works. Attached is the file as a patch. I would like to add little more support before I commit this. IE other entities properties, hierarchy ('parent column/field', which is sorted in a separate table in database)
Comment #2
istryker commentedFrom [#/1716912]
Need to add file to
draggableviews.infofile:Comment #3
istryker commentedI would like to get this into FieldAPI handler. For taxonomy handling see #1916380: Roadmap to add taxonomy support to module
Comment #4
jonmcl commentedI just gave this a try (on taxonomy terms) and it basically worked, except of course for lack of hierarchy.
One error I hit though: I have entities (from salsa_entity module) that don't have a base table defined. The module pulls entities from the cache (or from external service if cache is empty). Probably not exactly a kosher way of dealing with entities, but it might be a good idea to check the property before using it.
Line 95 of draggableviews_handler_property.inc, change from:
.. to ..
Otherwise this addition looks promising. Theoretically it should work with any entity that has a weight property?
Comment #5
rudiedirkx commentedI like it!
Why isn't it in yet? Works perfectly with 2.0 even, which is over 2y old.
Comment #6
damienmckenna@iStryler: please don't mark your own patches as RTBC, especially when you change the status at the same time as you upload it - the patches have to be reviewed first.
Putting this back to Needs Work based on JonMcL's comment.
Comment #7
damienmckennaAdding this to the 2.1 list as it seems to be almost finished.
Comment #8
PascalAnimateur commentedRe-rolled patch with suggestions from #4
Comment #9
istryker commentedI just looked at patch #1 yesterday. Again I like this approach. There is even a parent property, so I theoretically it is possible to do hierarchy with taxonomy. For example
$entity_wrapper->parent = $item['parent'].Comment #10
damienmckennaComment #11
istryker commentedFor this to get commit I want to get a handle of hierarchy property. We do not need to solve hierarchy property (we can create another ticket to solve it), but I want to have an understanding of how to solve it.
I have played around with taxonomy parent, and they put a spike in a simple solution. As I suggested in #9, $entity_wrapper->parent = $item['parent'] works for fixing non-taxonomy parents*. To add a parent to taxonomy you can do $entity_warpper->parent[] = $item['parent']. This adds a new parent, but does not delete/replace the old one. Taxonomies terms 1 to many parent ratio. The hierarchy taxonomy table does not have a unique id....all it has tid & parent. To delete/replace the old one, we would have to access X old value, add the new one then delete the old one.
* in addition to cloning draggableviews_handler_hierarchy_native to dragableviews_handler_hierarchy_property.
Comment #12
rudiedirkx commentedI've never understoond how taxonomy can have multiple parents. The db and object structure supports it, but the UI doesn't, and I've never seen an example. I don't think anyone uses it, because no contrib uses it. If you know of examples, please share.
Comment #13
rudiedirkx commentedI also don't understand how you would sort hierarchical taxonomy with this... I can't even make a view that looks like a taxonomy tree. Weights are too weird. It is super useful for custom tables though. I use it to order registrations in a waitinglist. Works like a charm.
Comment #14
PascalAnimateur commented@rudiedirkx you might want to take a look at the views_tree module.
Comment #15
rudiedirkx commentedReroll of #8 against current dev.
Comment #16
rudiedirkx commentedNew patch. Works for non-base-table too. And doesn't use entity metadata to save.
Comment #17
rudiedirkx commentedAnd a patch against 2.1 for my make file.
Comment #18
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 #19
rudiedirkx commentedThis issue is not just about taxonomy. It's about any column in any base table.
I don't know what "feature complete" means... This patch seems done to me. It can save weight into any column in any base table.
Comment #20
nwom commentedOh my mistake. I must have mixed it up with another issue. There were a few taxonomy hierarchy and weight issues open.
Comment #21
rudiedirkx commentedTitle was not perfect. This is better.