Как удалить из шаблона на PHP ? Подобный метод $this->_script = $this->_scripts = array(); не удаляет
Спасибо за ваш ответ на Stack Overflow на русском!
- Пожалуйста, убедитесь, что публикуемое сообщение отвечает на поставленный вопрос. Предоставьте как можно больше деталей, расскажите про проведенное исследование!
- Просьб помощи, уточнений или ответов на темы не относящиеся к вопросу.
- Ответов основанных на мнениях; приводите аргументы основанные только на реальном опыте.
Также, обратите внимание на заметку в справочном центре о том, как писать ответы.
Hi we have 2 different custom componenets running on a website (they aren’t loaded together, just have the same issue) and they have pagination. We are finding that when clicking on the pagination an error appears in the console saying «Joomla is not defined»
However this problem only happens when a user is logged in. If you are viewing the website as a guest the pagination works. I have looked at the source code and can only find this script tag when NOT logged in, if I am logged in, it disappears
I have tried a couple of solutions (eg adding JHtml::_(‘behavior.framework’);) to the components code but nothing works.
Would anyone know whats going on? It did work before, I don’t however know when it stopped.
- Comments
- n3t commented May 30, 2017 •
- Steps to reproduce the issue
- Expected result
- Actual result
- System information (as much as possible)
- Additional comments
- This comment has been minimized.
- Melvine9 commented Jun 2, 2017
- This comment has been minimized.
- andrepereiradasilva commented Jun 2, 2017
- This comment has been minimized.
- andrepereiradasilva commented Jun 2, 2017
- This comment has been minimized.
- Melvine9 commented Jun 2, 2017
- This comment has been minimized.
- joomla-cms-bot commented Jun 3, 2017
- This comment has been minimized.
- franz-wohlkoenig commented Jun 3, 2017
- This comment has been minimized.
- andrepereiradasilva commented Jun 3, 2017 •
- This comment has been minimized.
- joomla-cms-bot commented Jun 3, 2017
- This comment has been minimized.
- franz-wohlkoenig commented Jun 3, 2017
- This comment has been minimized.
- andrepereiradasilva commented Jun 3, 2017 •
- This comment has been minimized.
- n3t commented Jun 7, 2017
- This comment has been minimized.
- andrepereiradasilva commented Jun 7, 2017
- This comment has been minimized.
- weeblr commented Jun 7, 2017
- This comment has been minimized.
- andrepereiradasilva commented Jun 7, 2017 •
Comments
Copy link Quote reply
n3t commented May 30, 2017 •
Steps to reproduce the issue
- enable cache — progressive caching in Global configuration
- Create new contact in com_contact, add an email, enable contact form
- open JS console, to see errors
- go to frontend, open the contact form
- refresh the page for second time
Expected result
- no JS error
Actual result
- upon firs load, everything is OK
- upon second load JS error appears
keepalive.js…:1 Uncaught TypeError: Cannot read property ‘uri’ of undefined
System information (as much as possible)
- Joomla Fresh installation 3.7.2
- Protostar template
Additional comments
- if you see the html, upon first call there is line
- upon second load is limited to
This comment has been minimized.
Copy link Quote reply
Melvine9 commented Jun 2, 2017
I have the same issue.
Make click right on the window and show source. This give me the same lines
and cause some issue with dropeditor ( lines above)
Best Regards
Melvine
This comment has been minimized.
Copy link Quote reply
andrepereiradasilva commented Jun 2, 2017
- Use latest joomla staging
- Global config: System Cache = ON — Progressive caching
- Go to frontend — not logged, view source, the keepalive code is there
- Refresh page, view source, the keepalive json code is not there (there is no json at all)
Further info: seems JHtml::_(‘behavior.keepalive’); (that introduces that code) is not called in progressive cache mode (in no cache mode or conservative caching works).
In my case the keepalive was called by mod_login (the login box module)
A workaround is to disable progressive caching, but yes, confirmed the issue also.
This comment has been minimized.
Copy link Quote reply
andrepereiradasilva commented Jun 2, 2017
Ok, so IMO there are two sides of this issue:
- The JHtml::_(‘behavior.keepalive’); inside the mod_login template file is not being processed when cache in conservative mode.
- The keepalive js should not give error and always fallback to a default value in case of no json system.keepalive config.
Proposed a PR to try to solve «2.» #16452 — please test.
Reggarding «1.» have no idea — maybe someone that understands better the cache system can help.
This comment has been minimized.
Copy link Quote reply
Melvine9 commented Jun 2, 2017
Thank you very much, I will try
This comment has been minimized.
Copy link Quote reply
joomla-cms-bot commented Jun 3, 2017
This comment has been minimized.
Copy link Quote reply
franz-wohlkoenig commented Jun 3, 2017
closed as having PR #16452
This comment has been minimized.
Copy link Quote reply
andrepereiradasilva commented Jun 3, 2017 •
@franz-wohlkoenig the PR does not solve one part of the issue. Imho Should remain open until someone looks at the progressive cache issue
This comment has been minimized.
Copy link Quote reply
joomla-cms-bot commented Jun 3, 2017
This comment has been minimized.
Copy link Quote reply
franz-wohlkoenig commented Jun 3, 2017
This comment has been minimized.
Copy link Quote reply
andrepereiradasilva commented Jun 3, 2017 •
@franz-wohlkoenig maybe the cache issue is the same thing as #11203 but not sure
This comment has been minimized.
Copy link Quote reply
n3t commented Jun 7, 2017
Generelly, is keepalive neccessary in frontend? For example in login form? Or in Contact form. It could compromise security, as for example in contact it will keep user logged in even he leaves computer.
This comment has been minimized.
Copy link Quote reply
andrepereiradasilva commented Jun 7, 2017
Keepalive is used in forms because of the crsf token check. Anyway this issue as describe above is not a keepalive issue. is the progressive cache that makes this behaviour
This comment has been minimized.
Copy link Quote reply
weeblr commented Jun 7, 2017
#11203 does not appear to me as the same thing:
- The fix does not apply anyway, as it applied to controller and views, which are not used in modules
- #11203 happens with conservative caching, while this one is with progressive. Progressive being supposed to be more agressive caching, this kind of side effect might happen. Would be good to confirm whether the same happens with only conservative caching enabled or not.
- Agree that this should not cause a JS error, error should be caught and properly displayed
- Maybe caching for such modules should simply be disabled by users when progressive caching is enabled?
This comment has been minimized.
Copy link Quote reply
andrepereiradasilva commented Jun 7, 2017 •
- The fix does not apply anyway, as it applied to controller and views, which are not used in modules
Ok, my misunderstanding
- #11203 happens with conservative caching, while this one is with progressive. Progressive being supposed to be more agressive caching, this kind of side effect might happen. Would be good to confirm whether the same happens with only conservative caching enabled or not.
Only progressive cache.
- Agree that this should not cause a JS error, error should be caught and properly displayed
A PR was done to solve the keepalive js issue (better fallback), but since core.js is not loaded it can cause other js issues in other similiar situations.
- Maybe caching for such modules should simply be disabled by users when progressive caching is enabled?