Hi everyone,
A notice appears on a fresh install, 7.23 when I enable the linkit module while using CKEditor 4. In the WYSIWYG CSS settings. I've tried both the define css option and the pull from template option. It also reappears when creating a basic page node.
Here is the error:
Notice: Undefined index: stylesSet in wysiwyg_ckeditor_settings() (line 339 of /var/www/testSite/sites/all/modules/wysiwyg/editors/ckeditor.inc).
Lines 338-342:
if (!empty($config['buttons']['default']['Styles']) && version_compare($editor['installed version'], '3.2.1', '>=')) {
if ($styles = wysiwyg_ckeditor_settings_parse_styles($config['stylesSet'])) {
$settings['stylesSet'] = $styles;
}
}
I have tried putting isset() and empty() on the styles variable, and when I do that it makes the node creation page unusable.
Comments
Comment #1
alfthecat commentedGetting the same message but without the Linkit module installed.
I noticed the error gets printed as soon as I try to hide the node summary of a body fields (i.e. at /admin/structure/types/manage/article/fields/body#).
Notice: Undefined index: stylesSet in wysiwyg_ckeditor_settings() (line 339 of /var/aegir/platforms/[..]/sites/all/modules/wysiwyg/editors/ckeditor.inc).Getting this in the latest dev (WYSIWYG 7.x-2.2+23-dev ), didn't see it in the +17 version that I used prior.
I have tried to check the option of using the theme's CSS to see if that helped, but to no avail.
Comment #2
twodThe notice shows even after you saved the editor profile?
Try
Comment #3
alfthecat commentedHo TwoD,
I just rolled back to the +17 dev release but I can surely test the code. But I'm seeing:
Does that imply ckeditor 3.x?
Because I use ckeditor 4.x, that might explain something...
Comment #4
twodNote that the last parameter to version_compare() is
'>=', so this will apply in the case of CKEditor 4.x.Comment #5
twodNote that the Notice is harmless. It's simply stating that a setting is missing from the editor profile. Since the setting is empty, it wont' affect the editor. The setting is related to the Font Style plugin, so this notice only appears when that button/plugin is enabled.
It appears that the editor profile was last saved when the installed CKEditor library was version 3.2.1 or lower, which does not use the stylesSet setting. Since you're now using CKEditor 4.x, Wysiwyg now looks for the value of that setting in the editor profile. I simply forgot to check if that setting was defined before trying to use its value, in case of a situation like this. It does insert a default value for that setting when the editor profile is saved if using a CKEditor version above 3.2.1, so you should no longer see the notice after that.
Comment #6
digitalhorde commentedTwoD, thank you so much! This solved my issue, the notice is now gone. It looks like adding !empty($config['stylesSet']) did the trick. I really appreciate you taking the time to help
Comment #7
digitalhorde commentedThis has been tested in my Sandbox and seems to work! Would you like this rerolled as a patch?
Comment #8
rudivanes commentedHave the same issue. Can your provide a patch?
Comment #9
twodI've pushed the patch into 7.x-2.x and 6.x-2.x so the -dev snapshots should be rebuilt within 12 hrs. It just adds the missing
!empty($config['stylesSet'])condition to the if statement mentioned above.Thanks for reporting and participating in the issue!
Comment #10
twodFor reference, here's the 7.x-2.x commit: 3cb63de.