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.
Problem/Motivation
I need to reorder submitted data of the webform module.
It's useful when generating final list, using a field weight to order submissions.
I think it's a good feature because Views is the most important Drupal module, but Webform is the second.
Proposed resolution
Since the need for this is small, Create a submodule just like draggableviews_book.
Remaining tasks
Create view field code (Chi patch is a good start)
Determine if we want to use native handler or add a column to the submission table
User interface changes
There will be an addition field added to the view.
Original report by djpable, MrPaulDriver
Comment | File | Size | Author |
---|---|---|---|
#9 | draggableviews-support_plain_tables-2310289-9.patch | 1.83 KB | Chi |
| |||
#8 | draggableviews-webform_support-2310289-8.patch | 872 bytes | Chi |
Comments
Comment #1
djpable CreditAttribution: djpable commentedComment #2
joshuautley CreditAttribution: joshuautley commentedI found this issue because I too was looking to add a weight field for use with https://www.drupal.org/node/283498
(draggable views). We have many form submissions which we'd like to be able to manually drag and drop into the order needed.
Draggable views gives us the option to change the handler via FieldAPI but there are no fields that contain weight.
The Number field may work. I'll have to test. Nope that didn't work. )=
Anyone ever used draggable views with webform submissions?
Comment #3
iStryker CreditAttribution: iStryker commentedSo the ideal way would be to have the webform submission page be able to be reordered. If you did not have "Access Draggableviews" permission then you could still view the webofrm submission page, but not be able reorder.
I see no easy way to do this. I envision adding a weight field to the webform_submission table and a custom handler.
This custom handler might be able to be reused. Have it use any 'weight' column in the associated database table.
Comment #4
Chi CreditAttribution: Chi commentedComment #5
iStryker CreditAttribution: iStryker commentedThanks for the related link @Chi. I believe most of the progress will be made in #2143029, Unless, we add a custom handler like I stated in the last sentence in #3. The more I think about this, the more I see this as being practical for modules the have plain table with a weight value.
Comment #6
iStryker CreditAttribution: iStryker commentedThe issue in webform #2143029: Compatibility with draggable views is now closed. All future development will take place in this issue.
The chosen method for supporting this, is in a submodule.
Reasons:
Chi added a patch for webform today in #2143029-10. Attached is his patch.
I have not reviewed Chi patch, not thought this through completely.
Comment #7
DanChadwick CreditAttribution: DanChadwick commentedI can say that you do not alter the sid (submission id). You could alter the serial number, but only if you know you are within the submission for one node (same nid) and you don't create a serial number that is larger than what you already have in the table for that nid.
Comment #8
Chi CreditAttribution: Chi commentedThe patch adds just a few lines code. Do we really need a submodule for this? Notice that it uses the native draggable views sort handler. There is no need to add some extra weight field to webform module.
Comment #9
Chi CreditAttribution: Chi commentedHere is another patch. It is also quite simple but needs to be tested more carefully because it is more generic . The patch changes the way how draggableviews finds base tables. It makes draggable any base tables not only webform_submissions. I have tested it with Views Watchdog module and it works for me.
Comment #10
iStryker CreditAttribution: iStryker commentedAlright, this kinda blows my mind what you have done. If you can do this with any base table then we do not need a submodule.
I have tested your patch and I cannot get it working with Webform submission. I cannot get it to save to the draggableiviews_structure table. I cannot get it to sort with the draggableviews:weight sort. There is 2 fields now. Draggableviews:Content, Draggableviews:[name_of_base_table]....which one/both do I use.
Comment #11
kevster CreditAttribution: kevster commentedI know its been a while on this one but Im trying to get this working with no joy - Ive tried several combinations but when I save it doesnt save the order (or the row weight) - @iStryker did you get this working in the end?
Comment #12
kadsy CreditAttribution: kadsy commentedi can confirm the patch from #6 no longer working or it was just me. hope someone can spark some light here.