Closed (works as designed)
Project:
Weight
Version:
8.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Jan 2017 at 04:45 UTC
Updated:
6 Apr 2023 at 22:32 UTC
Jump to comment: Most recent
Comments
Comment #2
nwom commentedIf your field name is called "Weight" as an example, you'll have a "Weight Selector" field available in views. Add the Weight Selector field as the last field (doesn't have to be exposed). Now you can drag and drop within the view to change the order.
Comment #3
adsequor commentedIn views I'm reordering rows as desired. Is saving the new order supposed to work ?
Comment #4
adsequor commentedVisually reordering nodes in the view works fine but, when I click the saving button, node weights are not changed in database and I still have the initial weights.
Comment #5
ktrev commentedI am also facing the same issue. Node weights are not changed in the database.
Comment #6
ziomizar commentedFollowing #2 with the latest drupal and weight 8.x-3.x it works fine.
If you still have this problem feel free to reopen this issue.
Comment #7
subhojit777Followed #2. The weight is not saved after I click the save button. Tested on Drupal 8.6.4
Comment #8
ziomizar commentedThanks subhojit777 for reporting this.
That's weird as i wrote some tests to check this behaviour.
Maybe it depend on the machine name of the field, i will check it as soon as i get some time.
Comment #9
ziomizar commentedComment #10
ziomizar commentedI tried this again on simplytest.me with the rc1 version (same as dev)
- Add a new field `weight` to the basic page content type
- Create a view called `weight` with table format displayed as a page
- Added the field weight_selector to the view
- Removed all the sort criteria from the view
- Added as sort criteria just the `weight` field asc
It save the order correctly.
@subhojit777 do you have a custom configuration or some other modules that can interfere with weight?
Comment #11
subhojit777I don't think so. Weird. I followed the exact same steps and the weight did not save.
Comment #12
thihathit commented#10 works but doesn't work for other names. It does have problem with machine name.
Comment #13
ziomizar commentedI tried this again on simplytest.me with the rc1 version (same as dev)
- Add a new field `field_random1234` to the basic page content type
- Create a view called `ordered_items` with table format displayed as a page
- Added the field field_random1234_selector to the view
- Removed all the sort criteria from the view
- Added as sort criteria just the `field_random1234` field asc
It still working, so the machine name don't cause this issue.
@thihathit, @subhojit777 could you try with a simple view to see if it works for you?
Comment #14
thihathit commented@ziomizar sorry, turns out I've been using 3.0 instead of rc1. rc1 works properly. Thanks.
Comment #15
ziomizar commentedThanks thihathit,
I will try to release a stable version as soon as the rc1 have enought users to test it.
Comment #16
thihathit commentedCool ziomizar,
Excluding the selector handler field will not save the data even though the draggable icon is still appearing and able to re-order.
If that's not the issue, should there be a note on module page ? that says shouldn't exclude the handler.
Comment #17
ziomizar commented@thihathit that's a very good point.
I've created a follow up in #3025281: Update documentation so we can finally close this issue.
Comment #18
liquidcms commentedIt sounds like i should be able to get a draggable widget from this field on to a view listing my custom entities. I have tried a couple things:
1. i added a coded field to my entity with the code from comment #8 here: #2887710: weight_selector field missing for custom entity type. In views i then can place the Form Field field to get an integer selector or the basic Weight field which simply displays the integer value.
2. I added a Weight field via the std add Fields UI, but i get this error: There was a problem creating field Weight: The "checkbox" plugin does not exist.
It sounds like there is supposed to be a field_{fieldname}_selector field to add in Views, this does not exist.
this is all in ver 3.4.0
Comment #19
liquidcms commentedgot it.. even though option 2 (adding field through UI) failed due to checkbox plugin missing; the field was added.. and does work in my view. :)