?
avatar brianteeman
brianteeman
2 Oct 2019

Steps to reproduce the issue

  1. Make sure that joomla is installed in a subdirectory
  2. Go to a page that loads the codemirror editor. eg the template file editor
  3. Check that codemirror loads
  4. Go to the codemirror plugin
  5. Save and close without making any changes
  6. repeat steps 2 & 3

Expected result

codemirror loads

Actual result

codemirror fails

Inspect BEFORE codemirror fails

image

Inspect source AFTER codemirror fails

image

Comments

I suspect the problems origin comes from

// Append the editor script
if (!document.head.querySelector('#cm-editor')) {
const cmPath = this.getAttribute('editor');
const script1 = document.createElement('script');
script1.src = `${this.host}/${cmPath}`;
script1.id = 'cm-editor';
script1.setAttribute('async', false);
document.head.insertBefore(script1, this.file);

Note

To reset the plugin to the values before saving

INSERT INTO `h6nap_extensions` (`package_id`, `name`, `type`, `element`, `changelogurl`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`, `note`) VALUES (0, 'plg_editors_codemirror', 'plugin', 'codemirror', NULL, 'editors', 0, 1, 1, 1, '{"name":"plg_editors_codemirror","type":"plugin","creationDate":"28 March 2011","author":"Marijn Haverbeke","copyright":"Copyright (C) 2014 - 2017 by Marijn Haverbeke <marijnh@gmail.com> and others","authorEmail":"marijnh@gmail.com","authorUrl":"http:\\/\\/codemirror.net\\/","version":"5.40.0","description":"PLG_CODEMIRROR_XML_DESCRIPTION","group":"","filename":"codemirror"}', '{"lineNumbers":1,"codeFolding":1,"markerGutter":1,"lineWrapping":1,"activeLine":1,"selectionMatches":1,"matchTags":1,"matchBrackets":1,"autoCloseTags":1,"autoCloseBrackets":1,"keyMap":"","fullScreen":"F10","theme":"","activeLineColor":"#a4c2eb","highlightMatchColor":"#fa542f","fontFamily":"0","fontSize":13,"lineHeight":1.2,"scrollbarStyle":"native","preview":null}', 0, '0000-00-00 00:00:00', 1, 0, '');
avatar brianteeman brianteeman - open - 2 Oct 2019
avatar joomla-cms-bot joomla-cms-bot - change - 2 Oct 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Oct 2019
avatar SharkyKZ
SharkyKZ - comment - 3 Oct 2019

Test PR #25591 please.

avatar brianteeman
brianteeman - comment - 3 Oct 2019

yes that fiex it

avatar brianteeman brianteeman - close - 3 Oct 2019
avatar brianteeman brianteeman - change - 3 Oct 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-10-03 08:15:13
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment