Reviewed & tested by the community
Project:
Flag Weights
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Jan 2013 at 00:18 UTC
Updated:
7 Feb 2018 at 19:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
acrollet commentedpatch attached for review.
Comment #2
areikiera commentedThis works great for me so far. Thanks acrollet!
One of the features of Flag 3 is that is supports unique anonymous flagging (with the help of the Session API module), but this module stores information by UID, and so all changes to a Flags Weight change for all anonymous users who have it flagged. There is an SID field and I wonder if that could be used to store weights instead (or in addition to), and what changes would be required to support that.
I'm not a module developer, but would be happy to do what I can to help test and contribute to having this ability.
Comment #3
acrollet commentedareikiera: thanks for reviewing. IMO that should be treated as a separate feature request once there's a -dev branch of 3-x. If this patch works correctly for you as an update of the 2.x compatible module, perhaps you could set this issue to RTBC so that it can get in?
Comment #4
areikiera commentedCertainly! The updates to the draggableviews handler seem to be working as well. Thanks again for the patch!
I think this is an incredibly helpful module (big thank you to lyricmz), and getting it to work with the latest version of Flag would be greatly appreciated! I'd be happy to help with updated documentation if it helps lighten the load and helps get an updated version out more quickly. I agree with acrollet that a 3.x branch would make sense.
Thanks!
Comment #5
areikiera commentedWhile this is in the works, I did want to ask, should the flag weight be mapped to the draggableviews weight? My flag weights are updated with the proper weight after reordering, but I've noticed that the draggableviews weight field value doesn't match the flag weight field. My concern there is that if a user clicks "Show row weights" and tries to reorder through those values, it doesn't save in the expected order. I've attached a screenshot of what I'm seeing.
Comment #6
areikiera commentedAny updates on this? Thanks!
Comment #7
areikiera commentedReally hope the 3.x branch will be released soon! Please let me know if there is anything I can do to help!
Comment #8
arrubiu commentedAny news?
Comment #9
Andre-Bpatch does not apply without problems, since it introduces whitespace errors:
Comment #10
harcher commentedupdate?
Comment #11
robin van emden commentedWas able to make Flag 7.x-3.4, draggableviews 7.x-2.x-dev & flag_weights .x-1.x-dev work by applying this patch, together with #1545968-9: Add compability with DraggableViews 2.x
Comment #12
jay.lee.bio commented#1 worked perfectly for me. I didn't get the error at #9.
Comment #13
robloachUpdated, I believe.
Comment #14
jay.lee.bio commentedAfter disabling this module and not noticing any difference, I am a bit confused. Am I correct to assume that this module is now obsolete, since DraggableViews also has its own weight field? Or did I miss something?
Comment #15
robloachFlag Weights provides a weight field for user's set Flag, while DraggableView's weight field is for the View itself. While they are similar, they are used and architected different ways.
Comment #16
calbasiIt runs OK on Flag 7.x-3.6
Thanks a lot.
Comment #17
ericjgruber commentedI've applied the patch above and sadly, it's not working for me. I keep getting this issue:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'default_weight' in 'field list': SELECT default_weight FROM {flag} WHERE fid = :fid; Array ( [:fid] => ) in _flag_weights_get_default_weight() (line 181 of /Users/ericgruber/Projects/AO/docroot/sites/all/modules/contrib/flag_weights/flag_weights.module).Comment #18
shawngo commentedI ended up applying the patch manually against the latest dev branch (2013-Sep-30) and was getting the error:
Notice: Undefined property: stdClass::$flagging_node_entity_id in draggableviews_handler_flag_weights->set() (line 55 of sites/all/modules/flag_weights/handlers/draggableviews_handler_flag_weights.inc).
I made one change to draggableviews_handler_flag_weights.inc which correctly saved the flag weights and listed them in the correct weighted order:
I'm not sure how this would be handled using any other kind of entity (specifically pulling data from $result_item->nid). And not knowing why my patch didn't apply using git I'm not sure what might have changed between the dev branch and the patch in #13.
Comment #19
plusproduit commentedHello,
After applying the patch in #13 and Shawngo's patch in #18 I got the module to work with Flag 3.6 and latest Draggable views / views.
Please note that you must create the draggable view in "Master" display, and then add a page display. It's a Draggable views issue.
This module adds a very nice feature, and works with anonymous sessions as well (Session API required)
Thanks a lot!
Comment #20
zterry95 commentedthe patch always not working for me.
So I apply the patch by hand. here is the complete module tarball.
here is the working code for me. Hope it helps.
Looks it's difficult to request co-maintainer for this module. so I put it on the github.com
https://github.com/terryzwt/flag_weights
Comment #21
gumanov commentedIf anyone is interested, I posted a patch to get the DraggableViews (7.x-2.1) integration to work properly for other entity types, not just 'nodes'.
See here
Comment #22
nord102After applying #1, I was able to correctly install and enable Flag Weights without error.
However, when attempting to save my Flag Weights, I noticed that they weren't being saved. I currently have a view that has a Draggableviews: Flags field using the Flag Weight sort handler.
I noticed that in draggableviews_handler_flag_weights, the $item['id'] passed is the flagging_id as opposed to the entity_id. This was the reason that the flag weights weren't saving correctly.
Unsure if this situation/use case is too specific but I have attached a patch to #1 that uses flagging_id instead of entity_id in flag_weights_set_weight.
Comment #23
lbainbridge commentedHere's a re-roll of the patch in #1 that includes the changes proposed by nord102 in #22.
Comment #24
patoshi commentedIs there a quick tutorial on how to set this up? I'm able to expose the draggable handlebars to reorder the rows, but it doesnt save. I'm trying to use this for "flag lists" module.
I'm not sure if its even compatible. Anyone can list out how to go about setting up flag weights?
Comment #25
patoshi commentedActually i just used draggableviews module only without the need for this module. it works with the flag list module.