Timely Logo

HTTP Error While Uploading a Featured Image as an Event Contributor

WordPress Plugin (v.2.6.8 and older + old platform)

As of version 1.9 of the Standard and Pro Calendars, support was added for adding for Featured Images to events. This works well for all users that have the upload_files capability, which includes the Administrator, Editor, and Author roles.

However, we chose to avoid adding the upload_files capability to Event Contributors, because this capability grants full rights to edit and delete any uploaded media. Unfortunately, WordPress is not quite sophisticated enough provide the required fine-grained permissions control on file and media management operations, which many other CMSs enjoy.

For this reason, if you try to upload a Featured Image to your post when logged in as a user with the Event Contributor role, you will receive an HTTP Error similar to the following:

Interesting to note: You can see that this issue is not related to the calendar plugin, per se, by doing the following: Create a WordPress user with the Contributor role. While logged in as this user, start creating a regular Post, and try uploading a Featured Image for it. You should receive the same error message as above. In our opinion, the UI for uploading files should not be offered at all if your user role does not have the required capability. For this reason, we believe this issue can be characterized as a bug in WordPress core, not in our plugin.

How to work around this WordPress shortcoming

We suggest two possible workarounds to allow your Event Contributors to upload Featured Images for their events (until we have coded a better solution in an upcoming version of the plugin):

Direct users to the front-end Post Your Event form

If you have the Front End Submission add-on, you can invite your Event Contributors to submit events via the front-end form, which can be enabled under Events > Settings > Adding/Editing Events. Since we wrote the image upload function in that form ourselves, we could ensure that it would work for users with the Event Contributor role (and even anonymous users, if the appropriate option in Settings has been enabled).

Install a plugin that allows you to customize role capabilities

Warning: This option is not recommended if your Event Contributors are not trusted users, as it will allow them to edit or delete any previously uploaded media files.

You may install a WordPress plugin, such as Capability Manager Enhanced, to override the default permissions of your WordPress roles. After installing, enable the upload_files capability for the Event Contributor role. This will allow those users to upload a Featured Image for their events in the WordPress dashboard.

See more:

WordPress Plugin (v. 2.6.8 and older + old platform)

© 2023 Timely. All right reserved.