New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback for keepalive js #16452
Fallback for keepalive js #16452
Conversation
@andrepereiradasilva I did not tested, but looks good to me |
keepaliveInterval = keepaliveOptions && keepaliveOptions.interval ? keepaliveOptions.interval : 45 * 1000; | ||
|
||
// Fallback in case no keepalive uri was found. | ||
if (keepaliveUri === '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check only for empty string, for check all "false" cases use if (!keepaliveUri)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but i want to strict check for empty string :) see above
keepaliveUri = keepaliveOptions && keepaliveOptions.uri ? keepaliveOptions.uri.replace(/&/g, '&') : '',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay 😉
libraries/cms/html/behavior.php
Outdated
@@ -88,6 +88,10 @@ public static function core() | |||
} | |||
|
|||
JHtml::_('script', 'system/core.js', array('version' => 'auto', 'relative' => true)); | |||
|
|||
// Add core paths so javascript can have the root path. | |||
JFactory::getDocument()->addScriptOptions('system.paths', array('root' => JUri::root(true), 'base', JUri::base(true))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to 'base' => JUri::base(true)
?
After PR, I still get a js error:
|
@andrepereiradasilva I guess there still bug with 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 😉 |
another strange thing, upd. debug |
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 😄 )
that is the first problem of the issue that originated this PR see #16375 (comment) |
@andrepereiradasilva there is pull #16488 😉
Current pull should work after #16488 |
yeah this work after #16488 applied |
I am still getting the js error after both PRs are applied in the frontend.
|
@Quy did you refresh the js cache? UPDATE: Forget it i'm seing it also |
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. |
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. |
RTC after two successful tests. |
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:
Reproducing the issue:
Test if proposed keepalive fallback works:
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).