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.
Thanks for this awesome module, It will be nice to use 'entity media type' too. (Right now we can use 'node' type).
Comment | File | Size | Author |
---|---|---|---|
#14 | support_media_entity_type-3089597-14.patch | 1.19 KB | dkosbob |
#11 | support_media_entity_type-3089597-9.patch | 1.53 KB | goodDenis |
#8 | draggableviews-duplicates-items-3089597-8.png | 44.31 KB | iStryker |
#5 | Screenshot at Oct 24 22-18-14.png | 266.67 KB | goodDenis |
#3 | support_media_entity_type-3089597-2.patch | 1.68 KB | goodDenis |
Comments
Comment #2
goodDenis CreditAttribution: goodDenis as a volunteer commentedWith this patch, you can use 'node type' or 'media type', but not both. Because in the 'draggableviews_structure' table we don't keep 'entity type' and 'parent entity type'.
Comment #3
goodDenis CreditAttribution: goodDenis as a volunteer commentedFix getting entity, please use the latest path.
Comment #4
iStryker CreditAttribution: iStryker commentedTried your patch with Drupal core 8.7.7, latest 8.x-1.x. I see it does not work with a view of "Media" without your patch. With your patch it still does not work. No draggable + show up on the table.
Looking at the patch, it does look like it should work. What version of Core you using?
Comment #5
goodDenis CreditAttribution: goodDenis as a volunteer commentedIt works for me at 8.7.8
Did you see 'Draggableviews: Media' in the 'FIELDS'?
Comment #7
iStryker CreditAttribution: iStryker commentedGot it to work. Comitted
Comment #8
iStryker CreditAttribution: iStryker commentedWait I think this needs works. After saving 1 view with 3 images, and having the draggableviews demo with 5 items, now there is duplicates. Images go from 3 items to 6, DV Demos goes from 5 to 8. I think its because they have conflicting entity Ids. See attached image.
Comment #9
goodDenis CreditAttribution: goodDenis as a volunteer commentedI will try to check it, but right now I don't have much time, Changing the assigned status.
Comment #10
goodDenis CreditAttribution: goodDenis as a volunteer commentedComment #11
goodDenis CreditAttribution: goodDenis as a volunteer commentedThe problem was with join `draggableviews_structure` table to the view. We should add additional conditions `view_name` and `view_display`.
The SQL query was
LEFT JOIN {draggableviews_structure} draggableviews_structure ON media_field_data.mid = draggableviews_structure.entity_id
and I change it to
LEFT JOIN {draggableviews_structure} draggableviews_structure ON media_field_data.mid = draggableviews_structure.entity_id AND (draggableviews_structure.view_name = 'VIEW_NAME' AND draggableviews_structure.view_display = 'VIEW_DISPLAY')
Added patch.
Comment #13
iStryker CreditAttribution: iStryker commentedTest and committed. I am surprised this hasn't caused other problems with other issues.
Comment #14
dkosbob CreditAttribution: dkosbob at Message Agency commentedI'm fairly certain the views_query_alter committed in this issue broke the functionality of the module on my views. Removing it restores expected behavior. Here is a patch that just removes that for anyone who needs it, but it sounds like that may invalidate the work done earlier in this issue.
Comment #15
dkosbob CreditAttribution: dkosbob at Message Agency commentedComment #16
goodDenis CreditAttribution: goodDenis as a volunteer commentedHello, @dkosbob
Could you provide some information about the problem? Do you have any error message?
This hook_views_query_alter change JOIN
LEFT JOIN {draggableviews_structure} draggableviews_structure ON media_field_data.mid = draggableviews_structure.entity_id
to
LEFT JOIN {draggableviews_structure} draggableviews_structure ON media_field_data.mid = draggableviews_structure.entity_id AND (draggableviews_structure.view_name = 'VIEW_NAME' AND draggableviews_structure.view_display = 'VIEW_DISPLAY')
Comment #17
iStryker CreditAttribution: iStryker commentedIn theory it shouldn't because view display and view name are already added to the database. The commit just adds them to the query.
Comment #18
goodDenis CreditAttribution: goodDenis as a volunteer commentedComment #19
iStryker CreditAttribution: iStryker commentedReclosing isssue as only @dkosbob is having problems. There are other issue like his in other issues. Marking back as fixed for this issue.
Better solution #3158196: Allow any entity in DraggableViews::getIndex(). This is what I was looking for. It not mid or nid specific.
Comment #21
robertom CreditAttribution: robertom at bmeme commentedI have the same problem as @dkosbob
the problem is discussed on #3153830: DraggableViews not working after update to 2.0.0
Comment #22
dejan0 CreditAttribution: dejan0 at acolono GmbH for WWF Switzerland commented+1
same here