? ?
avatar C-Lodder
C-Lodder
15 Aug 2019

Steps to reproduce the issue

  1. In the Joomla backend, go to create an new article.
  2. in TinyMCE, click on CMS Content >> Read More

Expected result

Add a "read more" link to the article

Actual result

An alert saying one already exists.

screeny

avatar C-Lodder C-Lodder - open - 15 Aug 2019
avatar joomla-cms-bot joomla-cms-bot - change - 15 Aug 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Aug 2019
avatar brianteeman
brianteeman - comment - 15 Aug 2019

confirmed

avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Aug 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Aug 2019
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 15 Aug 2019
avatar infograf768
infograf768 - comment - 16 Aug 2019

One gets this wrong alert when the readmore is added in an empty textarea, otherwise it works fine.

The js does not take into account an empty textarea.

var content = window.Joomla.editors.instances[editor].getValue();

    if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
      Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
    } else {
      // TODO replace with joomla-alert
      alert(options.exists);
      return false;
    }

After modifying to

    var content = window.Joomla.editors.instances[editor].getValue();

    if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
      Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
    }
    else if (!content) {
    	Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
    } else {
      // TODO replace with joomla-alert
      alert(options.exists);
      return false;
    }

we have no more error and get the same behavior as in 3.x

avatar infograf768
infograf768 - comment - 16 Aug 2019

Closing as we have a patch
#25907

avatar infograf768 infograf768 - close - 16 Aug 2019
avatar infograf768 infograf768 - change - 16 Aug 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-08-16 16:33:37
Closed_By infograf768

Add a Comment

Login with GitHub to post a comment