Skip to content
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

Contao 3.2.21: ACE editor for composer.json does not work #283

Closed
fritzmg opened this issue Mar 7, 2016 · 3 comments
Closed

Contao 3.2.21: ACE editor for composer.json does not work #283

fritzmg opened this issue Mar 7, 2016 · 3 comments
Milestone

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Mar 7, 2016

Unter Contao 3.2.21 the composer.json editor will not work. The JavaScript console will show

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

<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

Prior to composer-client 0.16.2 the resource was loaded from cloudfront:

<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'].

@discordier discordier added the bug label Mar 7, 2016
@discordier
Copy link
Member

Was introduced with ce646bc to fix issue #248

@discordier discordier added this to the 0.16.4 milestone Mar 11, 2016
@discordier
Copy link
Member

Should be fixed with 6304366. @fritzmg please test

@fritzmg
Copy link
Contributor Author

fritzmg commented Mar 21, 2016

Yep, works fine.

discordier added a commit that referenced this issue May 3, 2016
Bugfix release:

Fix #261 Catch exception and show error message when fetching replacement map.
Fix #279 Database update page is now only shown if there is something to do.
Fix #281 Do not add "http://" repositories anymore.
Fix #283 Contao 3.2.21: ACE editor for composer.json does not work.
Fix #284 Update composer.phar defaults to false now.
Fix #286 FAQ now links to wiki for switch back to the old package manager.
Fix #287 correctly check for minimum PHP version.
Fix #288 CaBundleWorkaround fatal error with new composer.phar.
discordier added a commit that referenced this issue May 3, 2016
Bugfix release:

Fix #261 Catch exception and show error message when fetching replacement map.
Fix #279 Database update page is now only shown if there is something to do.
Fix #281 Do not add "http://" repositories anymore.
Fix #283 Contao 3.2.21: ACE editor for composer.json does not work.
Fix #284 Update composer.phar defaults to false now.
Fix #286 FAQ now links to wiki for switch back to the old package manager.
Fix #287 correctly check for minimum PHP version.
Fix #288 CaBundleWorkaround fatal error with new composer.phar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants