Problem/Motivation

Autologout recently dropped js_cookie and was asked to look into if we could too. Lets see :)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork quicktabs-3609965

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

smustgrave created an issue. See original summary.

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

joelpittet’s picture

Status: Active » Needs review
Parent issue: » #3609965: Replace js_cookie with localStorage for tab memory
joelpittet’s picture

joelpittet’s picture

Credited Marcos Hollanda (mabho) as that is where the localStorage changes came from in #2996076: Direct Link to a Quick Tab

joelpittet’s picture

Biggest difference here is that localStorage lives longer than the cookies did... those were session cookies, they only lasted while the browser was open. Now the last clicked tab "survives" a restart, and old cookies just get ignored.

The huge benefit is we get the same feature without the module dependency or cache-busting cookies! Nothing server-side ever read that cookie, it was just riding along on every request breaking Varnish/CDN caching for anonymous users.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

This looks great!

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Sweet, let's get this in :) Merge 🚂

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.

joelpittet’s picture

Title: Look into dropping js_cookie » Replace js_cookie with localStorage for tab memory

Status: Fixed » Closed (fixed)

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

nick hope’s picture

Thank you for replacing the js_cookie dependency. Quicktabs 4.3.1 is working fine for me in Druapl 11.4.5.

However, I encountered a problem when upgrading from Quicktabs 4.3.0 to 4.3.1.

An earlier Quicktabs update, quicktabs_update_103001(), explicitly installed the js_cookie module. Quicktabs 4.3.1 removes both the Drupal module dependency and the Composer dependency. Composer therefore removes the js_cookie code, but Drupal still has the module recorded as installed in core.extension.

The next database update then stops with the following error:

The following module is marked as installed in the core.extension configuration, but it is missing:
* js_cookie

I recovered by temporarily restoring the package, uninstalling the module through Drupal, and then removing the package again:

1. composer require drupal/js_cookie:2.0.1
2. drush pm:uninstall js_cookie
3. composer remove drupal/js_cookie
4. drush updatedb

This allows Drupal to perform the normal module-uninstall cleanup instead of manually removing entries from core.extension and system.schema.

joelpittet’s picture

Second person asked here #3616367: Updating 4.3.0 to 4.3.1 causes core.extension issue with js_cookie I think I over explained but maybe I am missing something?

joelpittet’s picture

Or maybe we need to gut that update hook?

joelpittet’s picture

Update hook was gutted actually https://git.drupalcode.org/project/quicktabs/-/blob/6dfa2dd80852e2b46ee4...

So check out the support issue, I can’t think of another reason off my head than transitive modules