-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Cannot add read more in editor of default install #20477
Comments
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
I CAN replicate on Firefox and Safari. Exactly the same error pointed by @PhilETaylor
|
Setting to confirmed This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20477. |
Here is the code for admin-article-readmore.es6.js: (() => {
'use strict';
const options = window.Joomla.getOptions('xtd-readmore');
window.insertReadmore = (editor) => {
if (!options) {
// Something went wrong!
throw new Error(`XTD Button 'read more' not properly initialized`)
}
const 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;
}
return true;
};
})(); If someone can make a pr I would really appreciate it 🙏 |
Thank @infograf768, now yes. I can replicate it. I thought I had the last staging. |
@dgrammatiko Files concerned And then correct the minified files. If I do that, no more errors. NOTE: What we have in core is different from what you pasted above |
Nope, I've already provided the code (it's also tested) |
@dgrammatiko |
the admin-article-readmore.js is generated from the es6 file, that's the source |
OK, then do it as I don't know how to. |
BTW, with your proposal I guess you don't have an error but also you can insert as many read more ( |
@dgrammatiko I can do it but I need some details: |
Yes in the es6 file. How to transpile to es5 and then minify can be found in #20396. You need npm installed. |
I postponed until now my digging into npm. Guess this is the opportunity. |
Thank your for stepping up to help. |
PR for joomla#20477 When editing an article on the front end it ws not possible to insert a readmore link This pr fixes that. Also test that it doesnt let you insert more than one readmore and that it still works in the admin
closed see #21207 |
* [4.0] Article readmore in frontend PR for #20477 When editing an article on the front end it ws not possible to insert a readmore link This pr fixes that. Also test that it doesnt let you insert more than one readmore and that it still works in the admin * hound fixes * consistenct
Steps to reproduce the issue
Edit article, select CMS Content dropdown, select read more.
Expected result
read more added to WYSIWYG
Actual result
JS Error
System information (as much as possible)
79fd949
Google chrome
The text was updated successfully, but these errors were encountered: