Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

license_key: 'gpl' currrently not working? #406

Closed
melino opened this issue Nov 17, 2024 · 2 comments
Closed

license_key: 'gpl' currrently not working? #406

melino opened this issue Nov 17, 2024 · 2 comments

Comments

@melino
Copy link

melino commented Nov 17, 2024

Our self-hosted TinyMCE 7 works like a charme in our Angular 18 app, but somehow we still get the console message

TinyMCE is running in evaluation mode. Provide a valid license key or add license_key: 'gpl' to the init config ...

We have tried all possible ways to get rid of it, of corse with license_key: 'gpl' within the confic object first, but also with the API key in the HTML, which isn't needed for self-host.
Now we come to the point that we think it could be an issue with the current version of TinyMCE.

Here's a Stackblitz with minimal setup.

Does anyone experience the same or knows a fix?

Image

@kemister85
Copy link
Contributor

kemister85 commented Nov 19, 2024

Hi @melino 👋,

After reviewing your Stackblitz demo, the issue stems from an incorrect format in your app.component.html. To resolve this, update your implementation to match the expected format as outlined in the Angular Integration Guide. Specifically, the licenseKey should be explicitly defined in the app.component.html file instead of being inherited from a service.

Correct Example:

<editor
  [init]="tinyMceConfig"
  initialValue="Start writing here..."
  [inline]="false"
  plugins="lists link"
  toolbar="undo redo | bold italic"
  licenseKey="gpl"
></editor>

Previously, the integration demo included the license_key: 'gpl' property in the service configuration, which caused a warning because it did not align with the expected format.

Additionally, update your tiny-mce-config.service.ts to the following:

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class TinyMceConfigService {
  config = {
    base_url: '/tinymce',
    suffix: '.min',
    promotion: false,
    branding: false,
  };
}

This ensures the configuration adheres to the recommended structure. Let me know if you encounter any further issues with your setup.

@melino
Copy link
Author

melino commented Nov 19, 2024

Great, solved. - Thank you!

For all that come after me: if it does not work with the first try, delete all your caches.

@melino melino closed this as completed Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants