Enable versioning for a component, modify an item of that component and save.
Then open "Versions" menu and try to compare two versions.
with a correct populated head:
The menu and the content are rendered incorrectly
The modal page doesn't contain any information in HEAD section
and if you click any of this button you have errors in the brower's console
Joomla 3.9.16
PHP 7.3
After some debug i've found that the problem is in
\administrator\components\com_contenthistory\views\compare\tmpl\compare.php
This piece of code is executed but doesn't produce any result.
JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/helpers/html');
JHtml::_('textdiff.textdiff', 'diff');
JFactory::getDocument()->addScriptDeclaration("
(function ($){
$(document).ready(function (){
jQuery('.diffhtml, .diffhtml-header').hide();
});
})(jQuery);
"
);
Also in the administrator\components\com_contenthistory\helpers\html\textdiff.php file
the paths seem incorrect
the current paths is:
com_contenthistory/diff_match_patch.js
com_contenthistory/jquery.pretty-text-diff.min.js
com_contenthistory/jquery.pretty-text-diff.css
The correct path should be:
com_contenthistory/js/diff_match_patch.js
com_contenthistory/js/jquery.pretty-text-diff.min.js
com_contenthistory/css/jquery.pretty-text-diff.css
JHtml::_('script', 'com_contenthistory/diff_match_patch.js', array('version' => 'auto', 'relative' => true));
JHtml::_('script', 'com_contenthistory/jquery.pretty-text-diff.min.js', array('version' => 'auto', 'relative' => true));
In a quick and dirty way i've found a shortcut to avoid this problem.
In \administrator\components\com_contenthistory\views\compare\tmpl\compare.php
i've added this piece of code in the html output, before the filedset tag:
<script type="text/javascript">
(function() {
// Load JQuery
var mainScript = document.createElement("SCRIPT");
mainScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js';
mainScript.type = 'text/javascript';
mainScript.onload = function() {
//Load textdiff CSS file
var cssFile = document.createElement("link");
cssFile.type = 'text/javascript';
cssFile.rel = 'stylesheet';
cssFile.type = 'text/css';
cssFile.href = '/media/com_contenthistory/css/jquery.pretty-text-diff.css';
cssFile.media = 'all';
document.getElementsByTagName("head")[0].appendChild(cssFile);
// Load bootstrap
var script1 = document.createElement("script");
script1.src = '/media/jui/js/bootstrap.min.js';
script1.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(script1);
// Load textdiff javascripts
var script2 = document.createElement("script");
script2.src = '/media/com_contenthistory/js/diff_match_patch.js';
script2.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(script2);
var script3 = document.createElement("script");
script3.src = '/media/com_contenthistory/js/jquery.pretty-text-diff.min.js';
script3.type = 'text/javascript';
script3.onload = function() {
var $ = window.jQuery;
$(document).ready(function (){
var containerId='diff';
jQuery('#'+containerId+' tr').prettyTextDiff();
jQuery('.diffhtml, .diffhtml-header').hide();
});
};
document.getElementsByTagName("head")[0].appendChild(script3);
};
document.getElementsByTagName("head")[0].appendChild(mainScript);
})();
</script>
There is something wrong in my joomla version or is known bug?
Thanks
Labels |
Added:
?
|
I'm agree for the problem with textdiff.php.
But why the code in compare.php do not produce any results?
This is the only component with this kind of issues and the history/tmpl/modal.php works fine.
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); JHtml::_('behavior.multiselect'); JHtml::_('jquery.framework');
Then post your whole system informations:
Backend > System > System Informations > The lines in tabulator "System Informations"
BTW: Your "Expected result" screen shot looks somehow weird, too.
And tell us which localhost server you use. XAMPP?
And how the directory structure of your Joomla installation is.
I'm using IIS 10.
obviously this is not my first joomla installation under windows system, but is the first time that i'm using the joomla versioning.
What do you mean
Your "Expected result" screen shot looks somehow weird, too.
PHP Built On | Windows NT QUAD-I7 10.0 build 18363 (Windows 10) AMD64
Database Type | mysql
Database Version | 5.7.14-log
Database Collation | utf8_general_ci
Database Connection Collation | utf8mb4_general_ci
PHP Version | 7.3.11
Web Server | Microsoft-IIS/10.0
WebServer to PHP Interface | cgi-fcgi
Joomla! Version | Joomla! 3.9.16 Stable [ Amani ] 10-March-2020 15:00 GMT
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
I have the same problem with the same component also on a linux server, this is our pre-production server, the host is on Siteground, and joomla was installed with the automatic deployment tool.
PHP Built On | Linux it14.siteground.eu 3.12.18-clouder0 #1 SMP Tue Oct 9 18:14:47 EEST 2018 x86_64
Database Type | mysql
Database Version | 5.6.40-84.0-log
Database Collation | utf8_general_ci
Database Connection Collation | utf8mb4_general_ci
PHP Version | 7.2.28
Web Server | Apache
WebServer to PHP Interface | cgi-fcgi
Joomla! Version | Joomla! 3.9.16 Stable [ Amani ] 10-March-2020 15:00 GMT
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
I can't reproduce your issue with XAMPP/localhost
Setting | Value |
---|---|
PHP Built On | Windows NT DELL-M6800 10.0 build 18363 (Windows 10) i586 |
Database Type | mysql |
Database Version | 5.5.5-10.1.34-MariaDB |
Database Collation | utf8_general_ci |
Database Connection Collation | utf8mb4_general_ci |
PHP Version | 7.2.7 |
Web Server | Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.7 |
WebServer to PHP Interface | apache2handler |
Joomla! Version | Joomla! 3.9.16 Stable [ Amani ] 10-March-2020 15:00 GMT |
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT |
User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0 |
I can't reproduce your issue with Linux/"standard" host:
Setting | Value |
---|---|
PHP Built On | Linux dd46134 4.15.0-76-generic #86~16.04.1-Ubuntu SMP Mon Jan 20 11:02:50 UTC 2020 x86_64 |
Database Type | mysql |
Database Version | 5.7.28-nmm1-log |
Database Collation | utf8_general_ci |
Database Connection Collation | utf8mb4_general_ci |
PHP Version | 7.2.24-nmm1 |
Web Server | Apache |
WebServer to PHP Interface | fpm-fcgi |
Joomla! Version | Joomla! 3.9.17-dev Development [ Amani ] 10-March-2020 15:28 GMT |
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT |
User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0 |
I don't think that it helps but try another browser, too.
I'll try your suggestion.
The weird thing is that under two completly different environments, with two different deployment methods i've the same results.
This is a server related issue the browser receive only the output from the server.
However thanks for your time.
Status | New | ⇒ | Closed - Unconfirmed Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-15 14:38:59 |
Closed_By | ⇒ | jwaisner |
Status | Closed - Unconfirmed Report | ⇒ | Closed |
Closed_By | jwaisner | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/28343
Closing as not a bug.
No. The "current paths" are correct because the JHtml method has a
relative => true
flagJHtml::_('script', 'com_contenthistory/diff_match_patch.js', array('version' => 'auto', 'relative' => true));
With that flag Joomla is searching automatically also in path
com_contenthistory/js/diff_match_patch.js
Aaaaand if Joomla doesn't find the files it's loading nothing.
I think your localhost installation is not configured correctly or your Joomla in a wrong directory or...
I wonder that your urls are pointing to http://localhost/administrator/ and not http://localhost/someOtherFolder/administrator/
Please ask in Joomla forum for help and describe there how and where you have installed your Joomla! For example: https://forum.joomla.org/