CuBoulder / express_mono

Monolithic Express Profile - contains all bundles
GNU General Public License v2.0
1 stars 2 forks source link

chg: changing logic to look for CLEAR token in title. #843

Closed AlanBCole closed 2 years ago

AlanBCole commented 3 years ago

Now the data flow is:

  1. If CLEAR token: (show no alert)
    • set rave_alerts_active_event to 0.
    • set rave_alerts_display to 0.
    • log clear event.
  2. If ACTIVE token: (still not showing anything)
    • set rave_alerts_active_event to 1.
    • log ACTIVE token is found.
  3. If no CLEAR token is found: (show alert)
    • set rave_alerts_display to 1.
    • log new rave rss event.

This seems like a decent replacement of the original code (see comments in #842), preserving its focus on the CLEAR token instead of the ACTIVE token. In the original code an alert was shown unless there was a CLEAR token in the title. The ACTIVE token was also searched for but that was not the condition that triggered an alert's display.

With these changes a [CLEAR] token should turn alerts off and its absence will 'turn on' an alert and log it. If there is an [ACTIVE] token there is an additional log entry and the setting rave_alerts_active_event = 1.

github-actions[bot] commented 3 years ago

Run Tests When Work Is Completed

Do not merge code before you run tests. Do the following when you have completed work on this PR and all of you reviewers have approved it:

  1. Add the Label "ReadyForTesting".
  2. If the tests pass:
    • Great!
    • Wait for you reviewers to approve the PR.
    • Merge when appropriate.
  3. If the tests fail:
    • You have more work to do!
    • Take the label off.
    • Make your changes.
    • Repeat these steps.
AlanBCole commented 2 years ago

While testing this again today, I noticed that the cache was never being emptied as expected. Apparently there is an issue with setting an expiration time in cache_set(). Basically, it doesn't do anything. (look here too -> https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_set/7.x#comment-58038)

Given the date of the comment linked to above, the rave_alerts module may have not been working 100% as expected for some years. Please do not merge this PR until I fix this as well.