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.
Comment | File | Size | Author |
---|---|---|---|
#9 | draggableviews-native-handler-incorrect-row-weight-2346561.patch | 811 bytes | jason@blaze |
#1 | draggableviews bug.png | 63.24 KB | sanjeevkumar |
Comments
Comment #1
sanjeevkumar CreditAttribution: sanjeevkumar commentedWhen i unchecked " New items appear bottom " in draggable order setting to show New item at the top
All list show same weight for all node items of page
also not save draging position
is any one know the solution?
its very urgent for my project
Comment #2
sanjeevkumar CreditAttribution: sanjeevkumar commentedIn dragable views module I trying to show new item on top of drag page it shows but when i save page after drag any content it not show saved content and show next page content I am using view pager in drag drop page
the following code is to show new item on top used in draggable module
It show the content correctly but after save weight not show again
$this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
value is saving in database correctly
Comment #3
dcam CreditAttribution: dcam commentedMoving this issue to the DraggableViews issue queue.
Comment #4
Erica_der_Whatkin CreditAttribution: Erica_der_Whatkin commentedCan you check that you don't have any of the columns set as sortable/default sort in the Views Format settings?
/me just spent a day and a half with the same issue.
Comment #5
iStryker CreditAttribution: iStryker commentedI think your view it not built properly, as I just test the lastest dev and unchecking "New items appear bottom of the list" works
Are you using expose filters?
Are you using contextual filters?
Can you attach a simple view I/We can test?
Are you using fieldAPI or native handler?
Also if you create a new content item, its weight will be 0. If you create all the content then they will all have the same weight.
Move issue to support request. Will close issue if no response in 2 weeks.
Comment #6
iStryker CreditAttribution: iStryker commentedComment #7
jason@blaze CreditAttribution: jason@blaze commentedI've run into this problem a few times over the last few months. I am (currently) running Drupal 7.38, Views 7.x-3.11 and DraggableViews 7.x-2.1. I'm using the native handler to store the row weight.
If I check off New items appear bottom of the list, everything works fine, and the Views query looks like this (only showing the SELECT portion):
However, if I leave it unchecked, the query looks like:
Notice the difference in the alias... draggableviews_structure_weight_coalesce vs. draggableviews_structure_weight. This causes an issue in draggableviews_handler_native->get(), since it's looking specifically for
$row->draggableviews_structure_weight_coalesce:
I adjusted the code to the following for the time being, and it fixed my problem:
Comment #8
iStryker CreditAttribution: iStryker commentedSuggestion looks sound. Makes me think if #1787764: Unknown column caused by orderby alias not matching field alias is still an issue. What if the alias is longing than 60 characters, then the result will always be 0.
Comment #9
jason@blaze CreditAttribution: jason@blaze commentedPatch attached.
Comment #10
David_Rothstein CreditAttribution: David_Rothstein commentedThis looks like a legitimate bug report with a patch, so I'm moving it to "needs review".
However, I think the patch in #2734155: Sorting using the native handler is broken in the latest dev version, especially when hierarchy is used will also fix this as a side effect.