? ? Failure

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
2 Jun 2017

Pull Request for Issue #16375 (only keepalive fallback part).

Summary of Changes

The keepalive js fallback is not working correctly when there is no system.keepalive json. This PR intends to add better fallback for those wild scenarios.

Testing Instructions

Pre-requisites:

  • Use latest joomla staging with a login module in the frontend (so keepalive is called)
  • In global config set joomla session to 1 minute (for faster test) and System Cache to "ON - Progressive caching"

Reproducing the issue:

  • Clear joomla cache
  • Go to frontend - not logged, reload the page two times (Ctrl+F5)
  • Confirm there is a js error in the Chrome Debug Console "Console" tab (F12)

Test if proposed keepalive fallback works:

  • Apply patch #16488 (if not merged) and them this patch
  • Repeat steps in "Reproducing the issue", but now confirm there is no js error in the Chrome Debug Console "Console" tab (F12)
  • Wait one minute and also confirm keepalive in called correctly in Chrome Debug Console "Network" tab

Expected result

Keepalive should always work even if there is no system.keepalive json.

Actual result

Keepalive does not work in this scenario because of a js error.

Documentation Changes Required

@dgt41 @Fedik can you also check this one and confirm there is no problem in adding the joomla install uri paths trough script options in behavior.core, ie, all the pages that use the core bahaviour (this would also be used in #15529).

avatar andrepereiradasilva andrepereiradasilva - open - 2 Jun 2017
avatar andrepereiradasilva andrepereiradasilva - change - 2 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jun 2017
Category Libraries JavaScript
avatar andrepereiradasilva andrepereiradasilva - change - 3 Jun 2017
Labels Added: ?
avatar Fedik
Fedik - comment - 3 Jun 2017

@andrepereiradasilva I did not tested, but looks good to me

avatar dgt41
dgt41 - comment - 3 Jun 2017

@Fedik can you also update the spinning logo to move this code instead of the data-attr (#15529)?

avatar Quy
Quy - comment - 3 Jun 2017

After PR, I still get a js error:

Uncaught TypeError: Cannot read property 'system.keepalive' of null
    at Object.e.getOptions (core.js?449d852…:1)
    at HTMLDocument.<anonymous> (keepalive.js?449d852…:1)
avatar Fedik
Fedik - comment - 3 Jun 2017

@andrepereiradasilva I guess there still bug with Joomla.loadOptions

there

if (!Joomla.optionsStorage) {
  Joomla.optionsStorage = options;
}

need to be:

if (!Joomla.optionsStorage) {
  Joomla.optionsStorage = options || {};
}

Can you add it here or I do new PR?

@dgt41 I thought that is your PR 😉
we can update, after this one will be merged

avatar Fedik
Fedik - comment - 3 Jun 2017

another strange thing,
with this patch, if cache is enabled, the core.js loaded but there no any <script type="application/json" class="joomla-script-options"> in the head.
maybe it somehow related to JCache::set(get)Workarounds ?

upd. debug off, and only on "Progressive caching"

avatar andrepereiradasilva
andrepereiradasilva - comment - 3 Jun 2017

@Fedik

Can you add it here or I do new PR?

please do a PR i prefer you do that Joomla.optionsStorage part - i will test it so it can be RTC and merged fast (hope @dgt41 tests it too 😄 )
this one stays in standby until your is merged

another strange thing,
with this patch, if cache is enabled, the core.js loaded but there no any <script type="application/json" class="joomla-script-options"> in the head.
maybe it somehow related to JCache::set(get)Workarounds ?

that is the first problem of the issue that originated this PR see #16375 (comment)
But that's another issue not related to js.

avatar Fedik
Fedik - comment - 3 Jun 2017

@andrepereiradasilva there is pull #16488 😉
which should fix:

Uncaught TypeError: Cannot read property 'system.keepalive' of null
    at Object.e.getOptions (core.js?449d852…:1)
    at HTMLDocument.<anonymous> (keepalive.js?449d852…:1)

Current pull should work after #16488

avatar andrepereiradasilva
andrepereiradasilva - comment - 3 Jun 2017

yeah this work after #16488 applied

avatar Quy
Quy - comment - 3 Jun 2017

I am still getting the js error after both PRs are applied in the frontend.

Uncaught TypeError: Cannot read property 'system.keepalive' of null
    at Object.Joomla.getOptions (core.js?cf50a49…:1)
    at HTMLDocument.<anonymous> (keepalive.js?cf50a49…:1)
avatar andrepereiradasilva
andrepereiradasilva - comment - 3 Jun 2017

@Quy did you refresh the js cache?

UPDATE: Forget it i'm seing it also

avatar andrepereiradasilva
andrepereiradasilva - comment - 3 Jun 2017

@Quy : @Fedik solved the issue in the other PR, should be fine now

avatar Quy
Quy - comment - 3 Jun 2017

I have tested this item successfully on 80d499b


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

avatar Quy Quy - test_item - 3 Jun 2017 - Tested successfully
avatar andrepereiradasilva andrepereiradasilva - change - 3 Jun 2017
The description was changed
avatar andrepereiradasilva andrepereiradasilva - edited - 3 Jun 2017
avatar Fedik
Fedik - comment - 3 Jun 2017

I have tested this item successfully on 80d499b

works as described, with #16488


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

avatar Fedik Fedik - test_item - 3 Jun 2017 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Jun 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Jun 2017

RTC after two successful tests.

avatar rdeutz rdeutz - change - 13 Jun 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-06-13 14:51:11
Closed_By rdeutz
avatar rdeutz rdeutz - close - 13 Jun 2017
avatar rdeutz rdeutz - merge - 13 Jun 2017

Add a Comment

Login with GitHub to post a comment