Make the script update after changes, without requiring cache clear

Created on 28 May 2025, about 1 month ago

Problem/Motivation

Currently it seems to be necessary to clear the cache to make an changes appear for users.

Steps to reproduce

Add or edit any experience, then visit a page where that experience should appear.

Proposed resolution

In function abjs_page_attachments(), in addition to adding the script, add a cache tag abjs.

In the submit methods of all forms, clear the abjs cache tag.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada alberto56

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

Comments & Activities

  • Issue created by @alberto56
  • 🇮🇳India flutterstack

    In this patch I am adding 'abjs' cache tag to the page. 'abjs' cache tag getting invalidated when you delete or edit or add expressions, conditions, tests ( admin/config/user-interface/abjs).

    You can see your changes in abjs javascript in

    tag without clearing the cache manually. Prerequisites:- Kindly apply https://www.drupal.org/files/issues/2025-05-06/abjs-drupal-11-and-latest-dev-commit-assertionerror-assert-is_string-field-in-assert-3515328-5-d11.patch patch also to make your abjs module to work. kindly review. thank you.
  • 🇨🇦Canada alberto56

    @flutterstack thanks for the patch, however I am not managing to apply it. When I run this:

    git clone --branch '2.0.x' https://git.drupalcode.org/project/abjs.git
    cd abjs
    curl -O https://www.drupal.org/files/issues/2025-06-15/abjs-drupal-11-Make-the-script-update-after-changes-3527098-1-d11_0.patch
    patch -p1 < abjs-drupal-11-Make-the-script-update-after-changes-3527098-1-d11_0.patch
    

    I get this error:

    patching file abjs.module
    patching file src/Form/AbjsConditionDeleteConfirmForm.php
    patching file src/Form/AbjsConditionForm.php
    patching file src/Form/AbjsExperienceDeleteConfirmForm.php
    patching file src/Form/AbjsExperienceForm.php
    patching file src/Form/AbjsTestDeleteConfirmForm.php
    patching file src/Form/AbjsTestForm.php
    Hunk #4 FAILED at 481.
    1 out of 4 hunks FAILED -- saving rejects to file src/Form/AbjsTestForm.php.rej
    
  • 🇮🇳India flutterstack

    thank you for the review. kindly try abjs-drupal-11-Make-the-script-update-after-changes-3527098-2-d11_0.patch .

  • 🇨🇦Canada alberto56

    Patch at #4 works great, thanks!

Production build 0.71.5 2024