Remove hard requirement for Rest UI

Created on 24 March 2021, over 3 years ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

Rest UI is currently required for installing webform_rest; this just seems to be a convenient way to get REST resources enabled, but not an actual requirement of webform_rest internals.

Removing the hard dependency will allow for a workflow where Rest UI is only used for development work, and never deployed to production. Potential benefits:

  1. Smaller surface of attack.
  2. Less risk of composer dependencies not resolving if Rest UI and Webform Rest get out of sync at some point.

Steps to reproduce

To verify that Rest UI is not really a hard requirement for webform_rest to work:

  1. Perform the normal steps to install + set up webform_rest (including installing restui).
  2. Set up the webform submission resource via Rest UI.
  3. Export the new configuration, a new rest.resource.abc.yml file must be created. Copy it somewhere else, should you need to manually restore it.
  4. drush pm:uninstall webform_rest restui
  5. Manually edit webform_rest.info.yml, remove the dependency upon restui:restui
  6. Remove drupal/restui: composer remove drupal/restui
  7. Install webform_rest again: drush pm:en webform_rest
  8. If rest.resource.abc.yml was deleted along the way, restore it manually
  9. Import configuration: drush config:import -y
  10. Verify that the configuration import works fine, and the REST endpoint for submitting webforms still works fine.

Note: I only tested with an endpoint for webform submissions, I didn't try other endpoints.

Proposed resolution

Remove restui as a hard dependency, use other mechanism(s) to suggest it: README.txt, message at install time or in status report page.

Remaining tasks

  1. . See README.txt
  2. Show a message at install time or in the status report page, detecting if Rest UI is present and suggesting to download and install it if not.

User interface changes

  • Developers won't get explicitly blocked when enabling webform_rest without restui.

API changes

None.

Data model changes

None.

📌 Task
Status

Fixed

Version

4.0

Component

Code

Created by

🇨🇴Colombia jedihe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024