Closed fritzmg closed 8 years ago
Unter Contao 3.2.21 the composer.json editor will not work. The JavaScript console will show
composer.json
ReferenceError: ace is not defined
for this line
var editor = ace.edit("composer_client_editor");
This is because ACE is integrated like so:
<script>window.ace || document.write('<script src="assets/ace//ace.js" charset="utf-8">\x3C/script>')</script>
i.e. the folder is incorrect, it should be
assets/ace/1.1.6/ace.js
This is because composer-client 0.16.3 uses
composer-client
0.16.3
<script>window.ace || document.write('<script src="<?php echo TL_ASSETS_URL; ?>assets/ace/<?php echo $GLOBALS['TL_ASSETS']['ACE']; ?>/ace.js" charset="utf-8">\x3C/script>')</script>
(https://github.com/contao-community-alliance/composer-client/blob/0.16.3/src/system/modules/!composer/templates/be_composer_client_editor.html5#L27) but the variable
$GLOBALS['TL_ASSETS']['ACE']
is not available in Contao 3.2.*, it was introduced in Contao 3.3.0: https://github.com/contao/core/blob/3.3.0/system/modules/core/config/config.php#L448
3.2.*
3.3.0
Prior to composer-client 0.16.2 the resource was loaded from cloudfront:
0.16.2
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
So for Contao 3.2.* it either needs to be the old cloudfront solution or
<script>window.ace || document.write('<script src="<?php echo TL_ASSETS_URL; ?>assets/ace/<?php echo ACE; ?>/ace.js" charset="utf-8">\x3C/script>')</script>
i.e. using the ACE constant instead of $GLOBALS['TL_ASSETS']['ACE'].
ACE
Was introduced with ce646bcf34da58da9169dd650911aae201405f99 to fix issue #248
Should be fixed with 63043660766a8d81a0a291cad7eb7722d8be1bee. @fritzmg please test
Yep, works fine.
Unter Contao 3.2.21 the
composer.json
editor will not work. The JavaScript console will showfor this line
This is because ACE is integrated like so:
i.e. the folder is incorrect, it should be
This is because
composer-client
0.16.3
uses(https://github.com/contao-community-alliance/composer-client/blob/0.16.3/src/system/modules/!composer/templates/be_composer_client_editor.html5#L27) but the variable
is not available in Contao
3.2.*
, it was introduced in Contao3.3.0
: https://github.com/contao/core/blob/3.3.0/system/modules/core/config/config.php#L448Prior to
composer-client
0.16.2
the resource was loaded from cloudfront:So for Contao
3.2.*
it either needs to be the old cloudfront solution ori.e. using the
ACE
constant instead of$GLOBALS['TL_ASSETS']['ACE']
.