joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Jooa11y plugin correction

Open Denitz opened this issue 3 years ago • 15 comments

Summary of Changes

  1. Disable page cache on Jooa11y active state
  2. Disable system caching on Jooa11y active state.
  3. Load plugin language only if plugin actually runs.
  4. Remove useless $direction and $lang vars.
  5. Prettify isAuthorisedDisplayChecker() method

Testing Instructions

Enable Joomla system cache plugin. Ensure that debug is disabled. Clear Joomla cache. Load frontend article as guest. See cache file in /administrator/cache/page folder Edit article in backend and perform "Accessibility Check". See extra file in /administrator/cache/page folder

Actual result BEFORE applying this Pull Request

An extra cache file is generated for each article

Expected result AFTER applying this Pull Request

Cache file is not generated.

Documentation Changes Required

No.

Denitz avatar Feb 16 '22 13:02 Denitz

@Denitz you do not need to keep updating your branch. Unless there are conflicts to fix its best if you dont as every commit will reset the test count

brianteeman avatar Feb 26 '22 08:02 brianteeman

Argh, sorry, I didn't know about test count.

Denitz avatar Feb 26 '22 16:02 Denitz

I have tested this item :red_circle: unsuccessfully on 74b13e59085656fb54e014f79d8d4fd5861ef46d

I'm afraid I cannot reproduce the issue.

I have tried this:

  1. Enabling conservative caching
  2. Enabling both conservative caching and page cache

Accesibility button only appears in frontend when the "show always" check is marked on the plugin configuration.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37068.

carcam avatar May 13 '22 16:05 carcam

@carcam Do you have Joomla debug enabled? Caching is not working in this case, should be disabled.

Denitz avatar May 25 '22 06:05 Denitz

Hi @Denitz thank you for your reply.

Debug is disabled and attached you may see some relevant screenshots of my current configuration.

Captura de Pantalla 2022-05-27 a las 16 44 56 Captura de Pantalla 2022-05-27 a las 16 44 46

Captura de Pantalla 2022-05-27 a las 16 45 49 Captura de Pantalla 2022-05-27 a las 16 45 35 Captura de Pantalla 2022-05-27 a las 16 45 25 Captura de Pantalla 2022-05-27 a las 16 45 16

Still no luck reproducing the issue in latest code from 4.1-dev branch...

carcam avatar May 27 '22 14:05 carcam

@carcam Not sure what's wrong, but it's really not replicated.

Moreover, assuming that Jooa11y injects assets via onBeforeCompileHead event, these assets can't be cached via view cache (caching in global config) for guests.

But, it's still cached with 'System - Page Cache' enabled for accessibility check preview URL like https://site.com/news/article-alias?jooa11y=1 (see ?jooa11y=1 appended). Having an extra cache file is useless.

I've updated summary of changes and test instructions.

Denitz avatar Jun 02 '22 05:06 Denitz

@carcam I found why it's not reproduceable anymore: recently, we have pushed the modules cache update and now the module cache only contains assets added by these module, but not all assets existing at the time of module generation. Before, the article was rendered and cached, next template is rendered, Jooa11y adds own assets via onBeforeCompileHead, next modules were rendered and cached (and the module cache contained Jooa11y assets). Anyway, the cache should be disabled on Jooa11y active state.

Denitz avatar Jun 02 '22 05:06 Denitz

I have tested this item :white_check_mark: successfully on 74532452abe6de599be00cfc11108f00f294046b

Hi @Denitz Thank you very much for rewriting the instructions!! I have been able to reproduce the issue and after applying the patch no files appear in the cache folder in any case. If that was the intention everything is fine ;).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37068.

carcam avatar Jun 10 '22 15:06 carcam

I have not tested this item.

It seems I cannot reproduce the issue.

If I open the article as guest, it creates cache file. Then, when I edit and check in backoffice the extra cache file is not generated (after and before applying patch). I copied the configuration from carcam


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37068.

Quiviro avatar Jun 10 '22 16:06 Quiviro

@brianteeman can you have a look here again if all is ok?

laoneo avatar Jun 21 '22 06:06 laoneo

I have tested this item :red_circle: unsuccessfully on 74532452abe6de599be00cfc11108f00f294046b

Cannot replicate the reported problem

Load frontend article as guest. See cache file in /administrator/cache/page folder - YES Edit article in backend and perform "Accessibility Check". See extra file in /administrator/cache/page folder - NO


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37068.

brianteeman avatar Jun 21 '22 13:06 brianteeman

@brianteeman Please ensure that system page cache plugin is enabled and you are not logged in frontend.

Denitz avatar Jun 22 '22 08:06 Denitz

pretty sure i set it up exactly as shown in @carcam screenshots but will double check

brianteeman avatar Jun 22 '22 08:06 brianteeman

This pull request has automatically rebased to 4.2-dev.

HLeithner avatar Jun 27 '22 13:06 HLeithner

This pull requests has been automatically converted to the PSR-12 coding standard.

joomla-bot avatar Jun 27 '22 21:06 joomla-bot

@Denitz Could you make 2 pull requests? One for the refactoring and one for the cache issue? Would be great, thanks.

obuisard avatar Aug 02 '23 17:08 obuisard

Sorry, I can't, this PR is simple enough.

Denitz avatar Aug 28 '23 18:08 Denitz

This pull request has been automatically rebased to 4.4-dev.

HLeithner avatar Sep 30 '23 22:09 HLeithner

Closed in favour of #41956

Denitz avatar Oct 03 '23 10:10 Denitz