J4 Issue ?
avatar PhilETaylor
PhilETaylor
23 Oct 2018

Steps to reproduce the issue

This doesn't happen on 3.8.13
Install Joomla 4.0-dev @ 9d3acfd
Login to Admin -> System -> Site Templates -> Cassiopeia Details and Files -> index.php

Expected result

Be able to see enough of the file to meaningfully edit it.
Only see one editor instance

Actual result

  1. only 19 rows of the editor are visible (on my laptop)

  2. On resizing the browser from big to small and back to big - I now get THREE editor instances!

screenshot 2018-10-23 at 20 39 28

System information (as much as possible)

Google chrome 70 on mac

Additional comments

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar PhilETaylor PhilETaylor - open - 23 Oct 2018
avatar joomla-cms-bot joomla-cms-bot - change - 23 Oct 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Oct 2018
avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 30 Oct 2018
avatar brianteeman
brianteeman - comment - 30 Oct 2018

Cannot replicate on Chrome 70 - windows

avatar PhilETaylor
PhilETaylor - comment - 8 Nov 2018

I can still replicate this today on all browsers on mac (Google Chrome, Safari, Firefox tested) which rules out this being a browser issue and rules out extensions in google chrome and rules out it being specific to my work mac (as its 0549am and Im at home now on a different mac)

Exact URL I'm on http://0.0.0.0/administrator/index.php?option=com_templates&view=template&id=510&file=L2NvbXBvbmVudC5waHA%3D

To replicate this, drag the right hand side of the browser to the left to crate a tall browser window (all the way, and back again)

Each time you do that you will get THREE textareas. Each time

screen recording 2018-11-08 at 05 48 am

avatar infograf768
infograf768 - comment - 9 Nov 2018

I am afraid I do not even get codemirror here (last branch version):

screen shot 2018-11-09 at 08 52 20

avatar PhilETaylor
PhilETaylor - comment - 9 Nov 2018

I am afraid I do not even get codemirror here

:-( Javascript error on page for you?

avatar infograf768
infograf768 - comment - 9 Nov 2018

Only this:
SyntaxError: expected expression, got '<'[Learn More] localhost:8888:2

avatar infograf768
infograf768 - comment - 9 Nov 2018

It is on a multilingual site btw.

avatar Scrabble96
Scrabble96 - comment - 4 Jan 2019

I am also getting this on joomla.com CloudAccess.net website, using Firefox. Currently five screens.
This is on J4.0 Alpha 7 dev.
image

avatar PhilETaylor PhilETaylor - change - 10 Feb 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-02-10 21:32:28
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 10 Feb 2019
avatar Scrabble96
Scrabble96 - comment - 3 Aug 2019

Why was this issue closed? Or is there a PR for it now? I'm still getting multiple instances of codemirror when resizing my desktop screen to a smaller width. I've just checked on the Joomla_4.0.0-alpha11-dev-Development-Full_Package build Sat 03 Aug 2019.

avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Aug 2019
Status Closed New
Closed_Date 2019-02-10 21:32:28
Closed_By PhilETaylor
avatar franz-wohlkoenig franz-wohlkoenig - reopen - 3 Aug 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Aug 2019
Status New Discussion
avatar Scrabble96
Scrabble96 - comment - 6 Jun 2020

Could this be linked to overrides in some way? When working on an override it is possible to have the three views, headed "Overridden file (editable)", "Original file (readonly)" and "Diff between original and overridden file" respectively. On re-sizing the wide desktop to a narrow view, each of the first two views is duplicated, but interestingly, not the 'differences' view. Resize back and forth again, and the first two views have four copies but the last one is still single.

avatar PhilETaylor
PhilETaylor - comment - 11 Jun 2020

Just to confirm this still happens today, and in beta 1

avatar shim-sao
shim-sao - comment - 30 Jul 2020

Still here in beta 3

  • Open browser tools (ctrl+shift+i) => ok
  • Close the tools => duplication of the editor
  • Re-open the tools => duplication of the editor again
    404 Failed to load resource: /media/vendor/codemirror/mode/text/html/text/html.min.js
  • ... duplication again & again
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22778.
avatar shim-sao
shim-sao - comment - 30 Jul 2020

I found a javascript error here : /media/plg_editors_codemirror/js/joomla-editor-codemirror.js

this.checkElement('CodeMirror', 'findModeByName').then(() => {
  // For mode autoloading.
  window.CodeMirror.modeURL = this.getAttribute('mod-path'); // Fire this function any time an editor is created.

On a second call a new instance of the editor is created with the bad url.
console.log(' modeURL = ' + this.getAttribute('mod-path'))

Adding a counter of instance seems to resolve the problem :

super()
this.n = 0
this.n += 1
if (this.n > 1) {
  return;
}
window.CodeMirror.modeURL = this.getAttribute('mod-path');

works also with multiple editors like in associations for example

avatar brianteeman
brianteeman - comment - 30 Jul 2020

Thats great - could you submit a pull request please

avatar shim-sao
shim-sao - comment - 30 Jul 2020

After several tests this created new bugs but I think I found where the error really came from.

if (this.instance !== '') {
  Joomla.editors.instances[this.element.id] = this.instance;
  return;
}

if you don't add the instance to the list, buttons like readmore don't work anymore

avatar richard67
richard67 - comment - 30 Jul 2020

Closing as having a PR. Please test #30240 . Thanks @shim-sao for the fix, it looks good to me at code review.

avatar richard67 richard67 - change - 30 Jul 2020
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2020-07-30 19:45:36
Closed_By richard67
avatar richard67 richard67 - close - 30 Jul 2020
avatar richard67
richard67 - comment - 30 Jul 2020

Feel free to re-open this issue if the PR doesn't fix it completely.

avatar richard67
richard67 - comment - 30 Jul 2020

Hmm, PR was closed, don't know why. New PR is #30241 . Please test.

avatar shim-sao
shim-sao - comment - 30 Jul 2020

I have create a new pull request because I don't have updated my fork before.
I discover a little github, very sorry :(

avatar richard67
richard67 - comment - 30 Jul 2020

Ok, no problem.

Add a Comment

Login with GitHub to post a comment