Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

OneHub

Security covered Under active development

This module connects to the OneHub API to allow users to upload files to OneHub via a field widget and display all files from a selected OneHub folder using a select widget. It also exposes OneHub file data to Views and includes a class for direct API calls.

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.

Ask your assistant about OneHub

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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 PHP Release date
8.x-1.0-beta8 Pre-release 8–10 Nov 20, 2023
8.x-1.0-beta7 Pre-release 8–10 Oct 2, 2023
8.x-1.0-beta6 Pre-release 8–9 Sep 29, 2023
8.x-1.0-beta5 Pre-release 8–9 Sep 13, 2023