Answers.Body: <p>With the help of the answer to <a href="https://civicrm.stackexchange.com/a/8193/50">How to disable or fix the wysiwyg editor on civimail</a> I managed to get it to not strip links by adding this line to the config:</p>
  
  <pre><code>config.extraAllowedContent = 'html;head;body;span;ul;li;table;td;style;a;a[*];*[id];*(*);*{*}';
  </code></pre>
  
  <p>It's different from the linked answer in that it explicitly reallows <code>a</code> and all its attributes.</p>
  
  <p>So while this provides a workaround to the problem, this file will get overwritten if I ever touch civi ckeditor settings and it's still not at all clear why this is needed in the first place. And more importantly, the toolbar is still missing the buttons.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-24T14:45:50.127Z
Answers.LastActivityDate: 2019-10-24T14:45:50.127Z
Answers.UserDisplayName: lynxlynxlynx
Answers.Body: <p>You didn't mention the path to the <code>config.js</code> that you're editing, which I think will help people answer your question.</p>
  
  <p>However, my guess is that you are installing Civi using the Roundearth plugin, because that would account for you having two different <code>config.js</code> files. I'm also guessing you're editing the file at <code>&lt;projectroot&gt;/vendor/civicrm/civicrm-core/bower_components/ckeditor</code>.  There's a second <code>config.js</code> at <code>&lt;projectroot&gt;/web/libraries/civicrm/bower_components/ckeditor</code>.  Hopefully this is enough to help you solve your problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-24T12:30:42.647Z
Answers.Text: Both config.js' have the "links" toolbar group item and nothing suspicious; moreover they're identical. crm-ckeditor-default.js that civi edits has an additional `groups: [ 'links' ]` submember, but adding that to the other two or removing it didn't change anything. And yes, I did install using civicrm-composer-plugin.
Answers.UserDisplayName: lynxlynxlynx
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-23T21:18:50.300Z
Answers.LastActivityDate: 2019-10-23T21:18:50.300Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I'm on 5.17.4 on drupal8 and civimail is working, html editing and all. But I don't know why. CKeditor loads and it's clearly not the drupal one (minimal), but it also doesn't fully match the editor config under Display Preferences. There are no console, server or civi log errors. It does take part of the preferences into account though; I can break the editor by choosing a skin or plugin that's not available.</p>
  
  <p>The pressing problem is that the toolbar does not contain the link buttons and there appears to be filtering involved, so even in the source view, adding anchor elements manually, eventually just filters them out, replacing them with the tag's content. So no way to add html links.</p>
  
  <p>So where is this third config coming from? Would this be the default CKEditor ships with and is somehow used instead of the civi provided one? What are the expected lookup paths?</p>
  
  <p>EDIT: I can even use <code>'CKEditorCustomConfig' =&gt; "adasdada"</code> in Resources.php and it changes nothing. I also tried hacking away what I found of ACF code in the drupal plugin part of CKEditor, but that didn't have an effect either.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-22T02:27:16.863Z
Comments.Text: Do you mean the editor for plain emails or the editor in the Mosaico email template tool?
Comments.UserDisplayName: tanbog
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-22T15:15:47.903Z
Comments.Text: I remember this happening on one site I was working on, it wouldn't take the settings here at /civicrm/admin/ckeditor into any consideration but then updating the module to the latest version and then clearing all caches seemed to help and I could make changes. Could you confirm whether the module is up to date just to eliminate it as a cause?
Comments.UserDisplayName: Jade
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-22T20:08:14.230Z
Comments.Text: vanilla editor, not Mosaico. And it's a new install, so everything should be up to date.
Comments.UserDisplayName: lynxlynxlynx
Tags: <civimail><ckeditor><drupal-8>
Title: CiviMail does not use the editor set in 'Display Preferences'
ThreadText: # CiviMail does not use the editor set in 'Display Preferences'
  
  (Asked by: username_0 on 2019-10-10)
  
  I'm on 5.17.4 on drupal8 and civimail is working, html editing and all. But I don't know why. CKeditor loads and it's clearly not the drupal one (minimal), but it also doesn't fully match the editor config under Display Preferences. There are no console, server or civi log errors. It does take part of the preferences into account though; I can break the editor by choosing a skin or plugin that's not available.
  
  The pressing problem is that the toolbar does not contain the link buttons and there appears to be filtering involved, so even in the source view, adding anchor elements manually, eventually just filters them out, replacing them with the tag's content. So no way to add html links.
  
  So where is this third config coming from? Would this be the default CKEditor ships with and is somehow used instead of the civi provided one? What are the expected lookup paths?
  
  EDIT: I can even use `'CKEditorCustomConfig' => "adasdada"` in Resources.php and it changes nothing. I also tried hacking away what I found of ACF code in the drupal plugin part of CKEditor, but that didn't have an effect either.
  
  **Tags:** civimail, ckeditor, drupal-8
  
  > **Comments:**
  > **username_1**: Do you mean the editor for plain emails or the editor in the Mosaico email template tool?  
  > **username_2**: I remember this happening on one site I was working on, it wouldn't take the settings here at /civicrm/admin/ckeditor into any consideration but then updating the module to the latest version and then clearing all caches seemed to help and I could make changes. Could you confirm whether the module is up to date just to eliminate it as a cause?  
  > **username_0**: vanilla editor, not Mosaico. And it's a new install, so everything should be up to date.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2019-10-24. Score: 1
  
  With the help of the answer to [How to disable or fix the wysiwyg editor on civimail](https://civicrm.stackexchange.com/a/8193/50) I managed to get it to not strip links by adding this line to the config:
  
  ```
  config.extraAllowedContent = 'html;head;body;span;ul;li;table;td;style;a;a[*];*[id];*(*);*{*}';
  
  ```
  
  It's different from the linked answer in that it explicitly reallows `a` and all its attributes.
  
  So while this provides a workaround to the problem, this file will get overwritten if I ever touch civi ckeditor settings and it's still not at all clear why this is needed in the first place. And more importantly, the toolbar is still missing the buttons.
  
  
  ---
  
  ### Answer by username_3 on 2019-10-23. Score: 1
  
  You didn't mention the path to the `config.js` that you're editing, which I think will help people answer your question.
  
  However, my guess is that you are installing Civi using the Roundearth plugin, because that would account for you having two different `config.js` files. I'm also guessing you're editing the file at `<projectroot>/vendor/civicrm/civicrm-core/bower_components/ckeditor`. There's a second `config.js` at `<projectroot>/web/libraries/civicrm/bower_components/ckeditor`. Hopefully this is enough to help you solve your problem.
  
  > **Comments:**
  > **username_0**: Both config.js' have the "links" toolbar group item and nothing suspicious; moreover they're identical. crm-ckeditor-default.js that civi edits has an additional `groups: [ 'links' ]` submember, but adding that to the other two or removing it didn't change anything. And yes, I did install using civicrm-composer-plugin.  
  
  ---
  
  