Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrockowitz created an issue. See original summary.

  • jrockowitz committed a92164d on 2857165-duplicate-submission
    Issue #2857165: Ability to clone a submission
    

  • jrockowitz committed 5bb9834 on 2857165-duplicate-submission
    Issue #2857165: Ability to clone a submission
    

  • jrockowitz committed c4f2cc9 on 2857165-duplicate-submission
    Issue #2857165: Ability to clone a submission
    
jrockowitz’s picture

Status: Active » Needs review
FileSize
10.36 KB

  • jrockowitz committed 06116ea on 8.x-5.x
    Issue #2857165 by jrockowitz: Ability to clone a submission
    
jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 0887c0f on 8.x-5.x
    Issue #2857165: Ability to clone a submission
    

Status: Fixed » Closed (fixed)

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

vunda’s picture

Hello, how I can get this functionally, cloning a submission from the webform.
Thanks,

jrockowitz’s picture

On the 'Results' tab, you just need to open a submission 'Edit' operations and click 'Duplicate'.

vunda’s picture

I'm getting the message: "This webform is not available. Please contact the site administrator. "

jrockowitz’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Do you have the ability to update any submission?

Can you replicate this issue using https://simplytest.me?

vunda’s picture

Yes, I can edit any submission.

I'm using version: '8.x-5.0-beta23'. Maybe, that's the problem. If it's it, what would be the best steps to update the webform module (a stable version). I don't want to lose the survey form I built. Thanks.

vunda’s picture

Ok, I updated the webform to 8.x-5.0-rc1. Still no working: I'm getting the message: "This webform is not available. Please contact the site administrator. "

jrockowitz’s picture

I think this is a permission issue.

Can you replicate this issue using https://simplytest.me?

vunda’s picture

It is working in https://simplytest.me

However, after I updated Drupal core version from D8.4.2. to D8.4.4 still no working.

The Admin (access) has all the privileges to create, edit, submit, delete...in the webform.

Any advice or suggestions.

jrockowitz’s picture

You need to figure out what is different on your local environment compared to simplytest.me.

vunda’s picture

I did. The weird part is that the Webform Demos are working.

jrockowitz’s picture

What are the permissions/access controls on your webform?

vunda’s picture

OK, after updating D8.4.4 and Webforms modules; both are working as should be. However, I lost several fields/elements. I have to recreate several of them. note:

In terms of permission:

I found that "replicating" a webform submission works fine, if you have the right permission on your D8 roles and permission settings. However, webform has its own, but is not working the way I am expecting.

For instance, I attached some images: I have a role called Admin-Final, and I had to click the "Administer webform submissions" to be able to "Duplicate a webform submission". It works but if I go back to the webform submission or in my case a survey form, I can see "View, Test, Results, Build, Settings and References" Tabs (on top of my survey form).

https://ibb.co/mUxG8b

https://ibb.co/kybF1w

I do not want that. I only need the result or view to replicate a survey submission.

If I take the permission "Administer webform submissions" off, then it works, but in my view page where I have the option "Duplicate" it doesn't work. Because of this permission, I tried different ways to get it the way I want and I found that it is not possible.

Is there any way to include a permission to control only the "Duplication, or editing..." without giving access to the whole webform setting, like Build, Settings and REferences.

Maybe, I am missing something, if somebody has any idea.

vunda’s picture

After selecting this option:
"Administer webform submissions
Warning: Give to trusted roles only; this permission has security implications. Note: To allow users to administer an individual webform's submissions, please go to the webform's 'Access' tab. Allows accessing, updating, and deleting all webform submissions."

When I go back to the webform submission or in my case a survey form, I can see "View, Test, Results, Build, Settings and References" Tabs (on top of my survey form).

I do not want that. I only need the result and view.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
5.66 KB

There was an issue with the access checking for a submission's operations.

Please test the attached patch.

Status: Needs review » Needs work

The last submitted patch, 23: 2857165-23.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jrockowitz’s picture

Status: Needs work » Needs review
FileSize
6.92 KB

  • jrockowitz committed b52f1ab on 8.x-5.x
    Issue #2857165 by jrockowitz: Ability to clone a submission
    
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

vunda’s picture

OK, thanks

vunda’s picture

First error: The fte (webform_markup) is a webform element that can not have any child elements.

I was trying to copy my YAML file...

jrockowitz’s picture

vunda’s picture

I wondered if it is possible to include the "Duplicate" option
separately in the roles/permission. The reason is because I have breeders who
want to clone their report without copying the survey again. I have a problem
showing that functionally without exposing the Edit, Build, and other options
on top of my webform survey.

See video: https://youtu.be/bvbeeCmNsjc

jrockowitz’s picture

The patch makes it so that you just need to grant ‘update any submission’ to user.

vunda’s picture

jrockowitz’s picture

Status: Fixed » Needs review
FileSize
2.15 KB

Thanks for the video. I was not looking at the 'administer webform submission' permission checks. I was only looking at 'view any submission'.

Status: Needs review » Needs work

The last submitted patch, 34: 2857165-34.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jrockowitz’s picture

  • jrockowitz committed 3ac53d2 on 8.x-5.x
    Issue #2857165 by jrockowitz: Ability to clone a submission
    
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch because it fixes a regression. Please download the latest dev release to review. If this solution does not fix your problem don't hesitate to update the ticket. Thanks for your patience.

vunda’s picture

It's working on my localhost, thanks for everything. I have to do some tests on the main website.
Thanks,

vunda’s picture

Jacob, thank you for all your help. It's working on a live website. So far permissions are working. I can control users permissions to see what they need to see the way I want it. This is perfect. I also fixed the problem of YAML child-elements errors. There are very easy ways to fix this problem. People don't need to recreate the whole webform. You can still use the existing YAML file and fix it. For instance if one of the elements is giving you an error, you can go back to the "build" and add the element that is causing the problem. After that go back to YAML, and keep working there. This is if you have saved all your webform in YAML.

vunda’s picture

I found a second issue with permissions. The webform has an option called "View All Webform Submissions" I checked that box for users to see all the webform submissions. I can also do that by using role>permission (local permission) However, in the webform survey at the top of the beginning of the form I can see two tabs, one called "View" and one called "Result". I don't want users to see that.
It there any fix for this.
Thanks,

vunda’s picture

I hope somebody can help with these topics:

Running Drupal 8 and Webform 8.x-5.0-rc1+75-dev (2018-Jan-29)

I have a problem showing View and Results after clicking on my webform survey.
On top of my form I can see two tabs. This is a problem because I can see all the records from other submissions.
I want to eliminate these tabs

This is the problem:
Image 1 shows tabs "View" and "Results (Also, I can see all the results or records by clicking on the Result tab).
https://imgur.com/a/g7saR

I want to eliminate these tabs.

This is correct but for some reason, after giving the right permission, it interferes with the webform permission (see image 1).
The second image shows my own webforms submissions result(s). It has access to duplicate/edit/delete my own webforms submissions.
https://imgur.com/a/g7saR

The third image shows a css class "Active"
Any suggestions,

Thank you

vunda’s picture

This option from permission is not working

Administer webform submissions
Warning: Give to trusted roles only; this permission has security implications. Note: To allow users to administer an individual webform's submissions, please go to the webform's 'Access' tab. Allows accessing, updating, and deleting all webform submissions.

It gives you full access, after that you click your own webform and shows VIEW and Results plus all the results from others users.

Too bad, it is the only one we have to display Edit/View/Duplicate

Any idea how to fix this....

vunda’s picture

How to implement a hook for the "Operations link" drop-down menu (Edit, view, notes, duplicate and delete)?

Status: Fixed » Closed (fixed)

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