1

Yesterday I updated one of my site to 2.9.0 (from 2.5.x ... yes I know ...) anyhow everything worked well except that the template editor is not working as before. Meaning:

  • I can't insert tab spaces anymore as then the editor move my cursor to the next field (Preference, Template name)
  • The Preferences, Access and Template notes block are always visible and I cannot collapse them anymore....

I'm just rebuilding the site of my customer and editing thousands of lines like this will not be easy ;-)

As anyone seen this before? thanks in advance for any hint.

Steven

  • I have yet to install the release of 2.9 but the developer preview had a new template editor in place that color-coded text and added line numbers. While nice and all, it broke the "TabinTA" add-on that I often use in FireFox to bridge the gap between the CP template editor and a stand-alone text editor. I requested a hidden config override be added so that the new editor could be turned off...EL said it wouldn't be a problem but I don't see it in the list:ellislab.com/expressionengine/user-guide/general/… Are you seeing line numbers in the code editor? – Michael Boyink Jul 23 '14 at 14:35
  • I've just upgraded from 2.8 - 2.9 and the Editor is working fine. By default I see line numbers and color-coded text, and tabbing works nicely. There is also a button on far top right, that toggles between this editor and alternative with no tabbing or colors option. If your preference toggles are not working either, may I suggest a javascript issue, perhaps something isn't loading. – Matt Jul 25 '14 at 2:48
  • Thanks for your reply. Actually no, I do not see line numbers, the background turns yellow when I click to edit anything but that's it. On top the Save and submit button does not quick the edit as before, it just save (not always) but remains in the template edit view ... Seems to me all broken or something went wrong with the update? Steven – Steven Jul 28 '14 at 14:55
  • @MichaelBoyink we incorporated a disabler without having a hidden config via the "Toggle Editor" button in the upper right hand side of the template editor page. – Derek Jones Jul 28 '14 at 22:40
  • Well, unfortunately the Toggle Editor button ha son function on my site, like the rest of the Template Editor it is malfunctioning – Steven Jul 29 '14 at 8:42
2

This was an odd one! It turns out it was a suhosin.get.max_value_length setting.

Any value over 128 characters, the variable was dropped from $_GET. And our combo loader specifies the files to pull in to create the js file via $_GET:

plugin=ee_codemirror&file=codemirror/codemirror,codemirror/closebrackets,codemirror/lint,codemirror/overlay,etc, etc, way more than 128 etc....

When the comboloader created the js file, there was no file value since it had been dropped entirely- and none of that code was being included in the resulting js file. Hence massive breakage.

Tweaking the server config gets it squared away.

| improve this answer | |
1

When working on larger projects, i usually write templates to files. That way you can more easily edit in a "real" editor (like sublime etc.) and store a copy in an archive or even version control with git or mercurial.

After everything works, you only have to sync all templates via the template manager once (and optionally disable templates as files to serve from database)

If you think there's a malfunction with template editor, maybe file a bug report.

| improve this answer | |
  • Hi, well if I would have knew that before I would have done that. But now the "Save as a file" is also not working anymore and just throwing error messages "Unable to save your template as a text file" – Steven Jul 29 '14 at 8:44
1

Did you remember to update your themes? There is new JavaScript in 2.9.0 that handles the improved template editor. If you open your console on that page, I'm going to guess you have a number of JS errors (which also explains why your fields at the bottom are toggled open).

| improve this answer | |
  • Thanks for your message :-) Yes, I did it, and did it again (to be sure) few minutes ago, but still same issue. – Steven Jul 29 '14 at 8:43
  • Forgot to answer a part. the console does not show any javascript error, nor other errors ... it was my first look ... it is really strange. – Steven Jul 29 '14 at 8:50
  • Update. Re-did a totally fresh install following strictly the instruction in the new manual (not using the Haddon Updater) and still the same, expect one thing ... now I see something in the console: [Error] ReferenceError: Can't find variable: CodeMirror o (index.php, line 12) (anonymous function) (index.php, line 12) each (jquery.js, line 16) each (jquery.js, line 16) toggleCodeMirror (index.php, line 12) global code (index.php, line 1) – Steven Jul 29 '14 at 12:46
  • Sounds like you are missing some JavaScript still, @Steven. Verify that in your theme folder on the remote server that you actually have /themes/javascript/compressed/codemirror/* and then try clearing your browser caches and refreshing. – Derek Jones Jul 29 '14 at 14:00
  • Thanks for the help. Well I looked for the core mirror files. This folder exists. Cache is clean, and this I tried on several browsers (Safari, Chrome, Firefox). I should also mentioned that the php version on the Debian 6 server was not the most actual one, so I updated it manually ... in case of. But still no luck unfortunately. Maybe another idea or check I could make? Thanks in advance :-) – Steven Jul 29 '14 at 20:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.