@davedg629
Yes, you are right.
I follow your suggestion, use the importmap, add css and js from CKeditor.com, and finally I can get CKEditor 5 loaded, but it does not work...
If I edit a content, the body and summary are loaded as "objects" inside the CKeditor form!
And If I edit a content: CKEditorError: can't convert null to object
So, this is too far from a clean and working solution.
Following the issue, finally you need to use npm, but some people does not be allowed to use or install npm in their sites.
IMO, a proper solution needs to be something like: install wysiwg, apply patch, download a full ckeditor5 zip, do some personal adn setup configs, and run.
Hi!
I do more tests and finally I start again.
Now I am not getting errors, but CKEditor is not loaded.
I follow this steps:
1) Get WYSIWG last version (7.x-2.10)
2) Install and enable it.
3) Apply this patch: https://git.drupalcode.org/project/wysiwyg/-/merge_requests/6.patch
4) Download the CKEditor 5 zip version from here: https://cdn.ckeditor.com/ckeditor5/42.0.1/zip/ckeditor5-42.0.1.zip
5) Extract to /sites/all/libraries/ckeditor5
6) Add a README.md file in /sites/all/libraries/ckeditor5 with this text:
build v42.0.0
7) Create the WYSIWG profiles for Full HTML and Filtered HTML and select CKEditor 5 42.0.0
Now it seems that every is ok?
Yes, it seems, but when I try to create a node, i get an empty textarea:
And CKEditor is not launched.
I do not see any errors on browser console.
Then I setup the profiles to allow the format selection, and I see that the default format is basic.
I switch to "Full HTML" and I get this error on console:
"Uncaught ReferenceError: ClassicEditor is not defined" in sites/all/modules/wysiwyg/editors/js/ckeditor5.js?sgobda:65
Any idea?
Regards,
Jordi
Hi, joseph.olstad.
Thanks for the update but I do not how to proceed with this.
I follow this steps based on your script.
1.- Download your zip and extract to /var/www/html/ckeditor5
Then:
[ec2-user@f4r-icreatia-dev www]$ cd html/ckeditor5/
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm install
up to date, audited 215 packages in 1s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[ec2-user@f4r-icreatia-dev ckeditor5]$
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm install ckeditor5-math
added 11 packages, and audited 226 packages in 5s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm install --save @ckeditor/ckeditor5-special-characters
up to date, audited 226 packages in 2s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm install --save-dev @ckeditor/ckeditor5-track-changes
up to date, audited 226 packages in 2s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm install --save-dev @ckeditor/ckeditor5-comments
up to date, audited 226 packages in 2s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm install --save @ckeditor/ckeditor5-dev-webpack-plugin
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global...
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated @ckeditor/ckeditor5-dev-webpack-plugin@31.1.13: This package is no longer maintained. Please, read the migration path: https://github.com/ckeditor/ckeditor5-dev/releases/tag/v32.0.0.
added 316 packages, and audited 542 packages in 16s
56 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[ec2-user@f4r-icreatia-dev ckeditor5]$ cp src/ckeditor.js src/ckeditor.js.orig
cp: cannot stat ‘src/ckeditor.js’: No such file or directory
[ec2-user@f4r-icreatia-dev ckeditor5]$ cp ../../../config-ckeditor.js src/ckeditor.js
cp: cannot stat ‘../../../config-ckeditor.js’: No such file or directory
[ec2-user@f4r-icreatia-dev ckeditor5]$ mkdir src
[ec2-user@f4r-icreatia-dev ckeditor5]$ cp ../config-ckeditor.js src/ckeditor.js
[ec2-user@f4r-icreatia-dev ckeditor5]$ npm run build
npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in: /home/ec2-user/.npm/_logs/2024-07-11T16_04_31_533Z-debug-0.log
And I stop here....
After these steps, I get this in /var/www/html/ckeditor5:
[ec2-user@f4r-icreatia-dev ~]$ cd /var/www/html/
[ec2-user@f4r-icreatia-dev html]$ cd ckeditor5/
[ec2-user@f4r-icreatia-dev ckeditor5]$ ls -ltr
total 488
-rw-rw-r-- 1 ec2-user apache 6252 Jul 11 17:24 main.js
-rw-rw-r-- 1 ec2-user apache 448 Jul 11 17:24 index.html
-rw-rw-r-- 1 ec2-user apache 3172 Jul 11 17:24 style.css
-rw-rw-r-- 1 ec2-user apache 55 Jul 11 17:24 vite.config.js
drwxr-xr-x 308 ec2-user apache 12288 Jul 11 18:01 node_modules
-rw-rw-r-- 1 ec2-user apache 461 Jul 11 18:01 package.json
-rw-r--r-- 1 ec2-user apache 456041 Jul 11 18:01 package-lock.json
drwxrwxr-x 2 ec2-user ec2-user 25 Jul 11 18:04 src
Why there is not a simple way to do this?
Regards,
Jordi
JOINSO
Also, note that https://ckeditor.com/ckeditor-5/online-builder/ now does not build a download.
So, we need to create some instructions to install Ckeditor5 without npm.
There a lot of sites that does not have this preliminary steps.
I think that is possible.
Hi, @joseph.olstad!
I follow your steps in #7 but I get this when trying to run the build script:
sh-4.2# ./build_ckeditor5.sh
Cloning into 'ckeditor5-math'...
remote: Enumerating objects: 573218, done.
remote: Counting objects: 100% (1495/1495), done.
remote: Compressing objects: 100% (668/668), done.
remote: Total 573218 (delta 940), reused 1279 (delta 818), pack-reused 571723
Receiving objects: 100% (573218/573218), 538.82 MiB | 25.11 MiB/s, done.
Resolving deltas: 100% (386510/386510), done.
Updating files: 100% (8062/8062), done.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ckeditor5@42.0.0
npm ERR! Found: dev @ckeditor/ckeditor5-mermaid@"ckeditor/ckeditor5-mermaid#v0.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @ckeditor/ckeditor5-mermaid@"ckeditor/ckeditor5-mermaid#v0.0.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-07-10T17_44_51_133Z-debug-0.log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ckeditor5@42.0.0
npm ERR! Found: dev @ckeditor/ckeditor5-mermaid@"ckeditor/ckeditor5-mermaid#v0.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @ckeditor/ckeditor5-mermaid@"ckeditor/ckeditor5-mermaid#v0.0.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
Do you know if I am doing something wrong?
Regards,
Jordi
JOINSO
Yes, you are right.
It works as expected.
I do not known if is the same case or perhaps I am missing something.
I put in context:
I have a content type A with a field A1: field storage "Paragraph": unlimited values, where this paragrah is a paragrah type with multiples fields.
Then I need to make a reference to any of the "values" of field A1 in other place (for example in a profile field).
I can only make the reference using a view, because there is not a direct way to make this.
I am using the last versions of "all".
Drupal: 10.2.3
Paragraphs:8.x-1.17
Hi!
I am interested in getting this to work.
What is the current status?
Anyone working on it?
Same error here.
Rollback to 1.29
@DamienMcKenna:
Thanks for the tip.
Few months ago, we released the new version of our site that is working with PHP 8.0 and D7.
Our solution was change this:
echo views_embed_view('usercomments', 'block');
To this:
$view = views_get_view('usercomments');
$view->set_display('block');
$view->pre_execute();
$view->execute();
if(count($view->result)>0)
{
?>
<div class="view-content">
<br/><br/><strong><?php echo t('My Reviews');?></strong><br/><br/>
<table>
<tr>
<td>
<?php echo t('Review Id');?>
</td>
<td>
<?php echo t('Edition Date');?>
</td>
<td>
<?php echo t('Review Preview');?>
</td>
<td>
<?php echo t('Published on');?>
</td>
<td>
<?php echo t('Type');?>
</td>
<td>
<?php echo t('Subscription');?>
</td>
<td>
<?php echo t('Actions');?>
</td>
</tr>
<?php
foreach($view->result as $key => $row)
{
$nodeComment=node_load($row->comment_nid);
$commentNotify=array();
$commentNotify[$row->cid]=(object)[];
comment_notify_comment_load($commentNotify);
?>
<tr>
<td>
<?php echo $row->cid;?>
</td>
<td>
<?php echo date("Y-m-d h:i:s",$row->comment_changed);?>
</td>
<td>
<?php echo f4r_tools_truncate_html($row->_field_data['cid']['entity']->comment_body['und'][0]['value'],20);?>
</td>
<td>
<?php
echo $nodeComment->title;
?>
</td>
<td>
<?php echo $nodeComment->type;?>
</td>
<td>
<?php
if($commentNotify[$row->cid]->notify)
{
echo t('Subscribed');
}
else
{
echo t('Unsubscribed');
}
?>
</td>
<td>
<a class='linkMyContent' href="/comment/<?php echo $row->cid;?>" target="_new"><?php echo t('View');?></a> |
<a class='linkMyContent' href="/comment/<?php echo $row->cid;?>/edit" target="_new"><?php echo t('Edit');?></a>
</td>
</tr>
<?php
}
?>
</table>
<?php
echo theme('pager');
}
At the moment I am not going to make more test because I am focused in migrating D7 to D10.
Hope this workaround can help other ones to fix the issue.
Regards,
Jordi
JOINSO
Solved.
In 10.0.9 this line in settings.php is allowed:
'isolation_level' => "SET SESSION tx_isolation='READ-COMMITTED'"
Now must be changeg to:
'init_commands' => [
'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
]
JOINSO → created an issue.
Found the issue: needs to update "Upgrade Status" with composer.
Can close now.
I downgrade PHP to 8.0.28 and works.
In the same instance a Drupal 7.98 with PHP 8.1 works perfect...
Any idea?
Regards,
Jordi
JOINSO
Just "disable/enable" clean urls or "clear cache" to fix.
So, in brief:
This is not safe in PHP 8.1:
$theme_group_titles = array(
'enabled' => format_plural(count($theme_groups['enabled']), 'Enabled theme', 'Enabled themes'),
);
If all the themes are disabled (status=0 in database).
Now this is solved fixing the database status in themes, but still getting "access denied" in some themes....
And more info:
In modules/system/system.module:
function function system_rebuild_theme_data() {
....
system_get_files_database($themes, 'theme');
...
}
I debug data before and after calling "system_get_files_database", and I get this in PHP 7.4:
[26-May-2023 08:44:06 Europe/Paris] Before Theme (adaptivetheme) :
[26-May-2023 08:44:06 Europe/Paris] Before Theme (adaptivetheme_admin) :
[26-May-2023 08:44:07 Europe/Paris] Before Theme (adaptivetheme_subtheme) :
[26-May-2023 08:44:07 Europe/Paris] Before Theme (bartik) :
[26-May-2023 08:44:07 Europe/Paris] Before Theme (f4r) :
[26-May-2023 08:44:07 Europe/Paris] Before Theme (garland) :
[26-May-2023 08:44:07 Europe/Paris] Before Theme (seven) :
[26-May-2023 08:44:07 Europe/Paris] Before Theme (stark) :
[26-May-2023 08:44:07 Europe/Paris] After Theme (adaptivetheme) :1
[26-May-2023 08:44:07 Europe/Paris] After Theme (adaptivetheme_admin) :1
[26-May-2023 08:44:07 Europe/Paris] After Theme (adaptivetheme_subtheme) :0
[26-May-2023 08:44:07 Europe/Paris] After Theme (bartik) :1
[26-May-2023 08:44:07 Europe/Paris] After Theme (f4r) :1
[26-May-2023 08:44:07 Europe/Paris] After Theme (garland) :0
[26-May-2023 08:44:07 Europe/Paris] After Theme (seven) :1
[26-May-2023 08:44:07 Europe/Paris] After Theme (stark) :0
And this in PHP 8.1:
[26-May-2023 08:46:34 Europe/Paris] Before Theme (adaptivetheme) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (adaptivetheme_admin) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (adaptivetheme_subtheme) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (bartik) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (f4r) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (garland) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (seven) :
[26-May-2023 08:46:34 Europe/Paris] Before Theme (stark) :
[26-May-2023 08:46:34 Europe/Paris] After Theme (adaptivetheme) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (adaptivetheme_admin) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (adaptivetheme_subtheme) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (bartik) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (f4r) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (garland) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (seven) :0
[26-May-2023 08:46:34 Europe/Paris] After Theme (stark) :0
More info.
Making some debug I get this:
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => sites/all/themes/adaptivetheme/at_admin/adaptivetheme_admin.info
[filename] => sites/all/themes/adaptivetheme/at_admin/adaptivetheme_admin.info
[name] => adaptivetheme_admin
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => sites/all/themes/adaptivetheme/at_core/adaptivetheme.info
[filename] => sites/all/themes/adaptivetheme/at_core/adaptivetheme.info
[name] => adaptivetheme
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => sites/all/themes/adaptivetheme/at_subtheme/adaptivetheme_subtheme.info
[filename] => sites/all/themes/adaptivetheme/at_subtheme/adaptivetheme_subtheme.info
[name] => adaptivetheme_subtheme
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => themes/bartik/bartik.info
[filename] => themes/bartik/bartik.info
[name] => bartik
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => sites/all/themes/f4r/f4r.info
[filename] => sites/all/themes/f4r/f4r.info
[name] => f4r
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => themes/garland/garland.info
[filename] => themes/garland/garland.info
[name] => garland
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => themes/seven/seven.info
[filename] => themes/seven/seven.info
[name] => seven
[status] => 0
)
[26-May-2023 07:43:11 Europe/Paris] Theme:stdClass Object
(
[uri] => themes/stark/stark.info
[filename] => themes/stark/stark.info
[name] => stark
[status] => 0
)
So, all my themes are disabled, and this:
$theme_group_titles = array(
'enabled' => format_plural(count($theme_groups['enabled']), 'Enabled theme', 'Enabled themes'),
);
Becomes not safe.
So, I am going to study how to enable themes....
A suggestion to improve this:
if all themes are disabled, does not let the admin page fails.
Hi!
I add more info:
Active themes:
MY_THEME (a subtheme of Adaptive Themes(AT))
AT Admin 7.x-3.5
AT Core 7.x-3.5
Bartik 7.97
Seven 7.97
If try to go to:
/admin/appearance/settings/bartik
I get an access denied,
but now if I go to /admin/appearance/settings/seven
JOINSO → created an issue.
Solved.
Missing to add extra config on .htaccess
Regards,
Jordi
JOINSO