Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

OneHub

Security covered
View on drupal.org

This module allows connection to the OneHub API and has two widgets:

1. Field widget to upload files to OneHub.
2. Select widget to display all files within a selected OneHub folder.

Alpha21+ requires at least Drupal 8.7.0

File Widget

It is a file type widget, however no file is stored locally. All files used through the widget are stored on OneHub. There is a reference on the entity where the widget is to the file.

Setup

  1. You will need a developer OneHub account in addition to your regular OneHub account. The developer account is used for the API only.
  2. With your application setup in your developer account, go to admin/config/services/onehub/settings and enter the required fields.
  3. Click on the authorize tab and then hit the authorize button to establish an Oauth connection.
  4. On your entity, add a field, then select Reference -> OneHub File.

On entity edit, you will be able to upload a file, select the workspace and folder where it will go. On the entity view, you will see a button to download the file form OneHub.

Select Widget

See the setup for the File Widget above. The only difference is On your entity, add a field, then select Reference -> OneHub Select.

On entity edit, select your workspace and folder. When you view the entity, all the files for the folder will be displayed.

Views

The OneHub file table is also exposed to Views.

Cron / Updating

I strongly recommend using a module like Ultimate Cron to update the OneHub records. To save time, OneHub's info is stored in Drupal's DB. So, these records need to be updated regularly to make sure you are in sync.

When you set up your cron mechanisms, I wouldn't do it more frequent than 15 mins. It takes about 3-4 mins to update the site if you have thousands of OneHub files.

There is also a manual updater located at /admin/config/services/onehub/update that you can use to manually update the tables via a batch mechanism.

API

It also comes with a method to call the OneHub API endpoints as well. Almost all the calls are already built with the OneHubApi Class, but you can still utilize this to write your own logic if need be.

use Drupal\onehub\OneHubApi;

function whatever() {
  $oh = new OneHubApi();
  $params = []; // Any additional params you need to pass to the call. 
  $api = $oh->callAPI('endpoint', 'GET/POST/PUT/DELETE', $params);
}

You can also extend the class obviously for a more OO approach.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Sep 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
8.x-1.0-beta8 Pre-release Nov 20, 2023
8.x-1.0-beta7 Pre-release Oct 2, 2023
8.x-1.0-beta6 Pre-release Sep 29, 2023
8.x-1.0-beta5 Pre-release Sep 13, 2023