When a view has a relationship, and the draggableview weight should be related to the entities defined from this relationship, it appears to be attached to the base view entity instead.

Comments

Alex Bukach created an issue. See original summary.

alex.bukach’s picture

Assigned: alex.bukach » Unassigned
Status: Active » Needs review
StatusFileSize
new633 bytes
istryker’s picture

How to test? I create a random relationship?

alex.bukach’s picture

@iStryker, here's an example how it can be reproduced:

  • Create a view displaying nodes.
  • Add node author relationship to the view.
  • Add aggregation for node title so that the view displays number of nodes for each user (so that we have a single row per user).
  • Add a user draggableviews sorting and field and select it to work for the node author relationship (i.e. now we can sort the users by dragging).
  • Check the resulting draggableviews form HTML and see that the rows IDs are NIDs, not UIDs.
  • Make sure that the reordering and clicking "Save" doesn't actually save the order.
  • Apply the patch and make sure that the IDs now are UIDs, and the order saving now works.

It's not exactly the case I had a problem with, but probably it's the easiest way to reproduce the issue.

istryker’s picture

Status: Needs review » Needs work

So I tried Draggableviews Demo with 5 nodes. The setup you described threw 5 errors (one for each node). The patch got rid of the errors, however, only one entry got added to the database when you save the order (therefore the order is not saved correctly). There should be one entry for each node.

I tested your patch with 8.x-1.0 and the current 8.x-1.x-dev (which needs to be re-rolled)

alex.bukach’s picture

Status: Needs work » Needs review

@iStryker apparently I was not clear enough. From what you describe looks all your nodes had the same author. If so, the described behaviour is the correct one: when you sort authors and there is a single author, only one record is created.

I mentioned there must be aggregation enabled in the view with counting number of nodes per author, so that you have a single line per author.

  • Alex Bukach authored 9887d7d on 8.x-1.x
    Issue #2853973 by Alex Bukach: Does not respect relationships
    
istryker’s picture

Status: Needs review » Fixed

Looks good, It fixed the problem.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.