Skip Navigation

[Resolved] User cannot upload file on 'Media Add' button of CRED write form

This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Author
Posts
#425361
Write-form-wysiwyg-Whaline02.png
Write-form-wysiwyg-Whaline01.png
Write-form-by-credform-Whaline00.png

I created write post form by CRED post form for 'Subscriber' user.
They can write posts like a screenshot.
But They cannot upload file via 'Media Add' button on WYSIWYG form.
When they try upload the file, Message appear like this 'You don't have permission to attach files to this post'.

So, I did things below :

* First, Registerd members only can write that custom post type (called 'Tasting Diaries'). They only can read and delete their own post.

1. I gave the some permissions to 'Subscriber' user via 'Toolset Access Control'.
- Read / Preview any / Edit own / Delete own / Publish permission on Media, Post, Page, Custom post type (called 'Tasting Diaries'), Post Forms Front-end Access Group, User Forms Front-end Access Group

2. I gave the some permissions to 'Subscriber' user via 'User Role Editor'.
- Read, Unfiltered upload, Upload files, Delete/Edit/Publish posts, Delete/Edit published posts, Delete/Edit/Publish pages, Delete/Edit published pages, Delete/Edit/Publish/Read Media
- Delete/Edit/Publish 'Tasting Diaries'

Write Page : hidden link
Test account : tester / test123890

What should I do to solve this problem?

#425418

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I checked your site and was able to see the problem, and so I set up a simple test installation where I was also able to reproduce the issue.

I could not find a variation of the Access settings that would enable a user with subscriber role to add media, and so I have escalated this thread so that our developers can investigate further and hopefully find a solution in time for the upcoming Toolset update.

When I hear from them I will let you know.

Thanks for your patience.

#426018

Hi, Nigel.
Thanks for your reply.

I resolved that.
Line 3000 code in '/plugins/types-access/includes/Helper.php' was a cause of problem.

2999 - // Not sure why we didn't use this mapping before
3000 - $capability_requested = self::wpcf_access_map_cap($capability_requested, $post_id, $user_id );

After I deleted that code on line 3000th, permission to upload file is working nomarlly.
I don't know what that code does mean, And how that code does affect whole plugin function.
Even you commented 'Not sure why we didn't use this mapping before'.
Please let me know deleting that code on the line 3000th if it is ok or not.
And what does that code mean?

#426970

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I just wanted to let you know that the next release of Toolset is imminent and we want to do some more version with the latest update to confirm if it is still present. I will re-test but you might want to re-test your live site, too, because your workaround will be overwritten by the update.

#428106

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Just to let you know we pushed the release of the updated Toolset plugins today.

I did some quick testing and it appears that this issue is fixed, if you want to try yourself and let me know.

#429604

My apologies for the late reply.
I cleared the seat for a week.

Anyway it works clearly.
After plugin updated, the problem is gone.
But, I have had another problem 🙁

Please check the next post :
https://toolset.com/forums/topic/some-errors-with-cred/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.