Problem/Motivation

When updating from CAS 2.x to 3.x, the new js_cookie dependency is not installed. If installing CAS 3.x from the start, js_cookie is installed as expected. I noticed when installing a new site from an install profile that it was failing because js_cookie was not in core.extension.yml.

Steps to reproduce

1. Install a new Drupal 10 site
2. composer require 'drupal/cas:^2.3'
3. drush en cas -y
4. composer require 'drupal/cas:^3.0@beta'
5. drush updb -y
6. Verify that js_cookie is not enabled

Proposed resolution

Add a post_update hook that installs js_cookie if CAS has gateway auth enabled and is configured to use the client side redirect.

Update the CAS config form to prevent users from enabling gateway auth with client side redirect if the module is not already installed (add a form validation error?)

Update our JS for client side auth to confirm that the Cookie library is available. If not, just back out and do nothing. This will prevent JS errors.

Remove JS cookie as a module dependency in the .info.yml file

Issue fork cas-3528901

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vinmassaro created an issue. See original summary.

bkosborne made their first commit to this issue’s fork.

bkosborne’s picture

Issue summary: View changes

Yea this was missed.

We have only one feature that uses this, which is the client-side authentication method for gateway authentication. I imagine most sites don't use this, so we should consider not installing the module for everyone.

Updated the proposed resolution...

bkosborne’s picture

Issue summary: View changes
dimitriskr’s picture

Is it a better idea to move this functionality into a submodule?

* (functionality === client-side authentication method for gateway authentication) so that js_cookie can be set as a clear dependency?

bkosborne’s picture

Maybe! It may be a bit tricky to pull the logic out of the main module.

bkosborne’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • bkosborne committed a8e57c52 on 3.x
    Issue #3528901: Add missing update hook to ensure js_cookie is installed...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.