If you go to page admin/reports/status the variable wysiwyg_imageupload_imgstyles returns to default (for version <= 6.x-2.8)
I find in the file wysiwyg_imageupload.install that the function wysiwyg_imageupload_requirements($phase) does not check if the variable is set and overrides the value.
This is my fix:
function wysiwyg_imageupload_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
require_once('wysiwyg_imageupload.module');
$value = variable_get('wysiwyg_imageupload_imgstyles', FALSE);
if ($value == FALSE) {
variable_set('wysiwyg_imageupload_imgstyles', 'Spacing 20px Border=imgupl_styles_spacing_20_black_border
Black Border=imgupl_styles_black_border
Spacing 5px=imgupl_styles_spacing_5
Spacing 10px=imgupl_styles_spacing_10');
}
}
return $requirements;
}
Now all my new styles are still in the variable!
I hope this fix will be added in new release.
Thank you.
WYSIWYG Image upload 6.x-2.8
jQuery Update 6.x-2.0-alpha1
jQuery UI 6.x-1.4 (1.7.x)
Wysiwyg 6.x-2.1 (CKEditor 3.4.2)
Comments
Comment #1
eletre commentedI used diff to create the patch file.
I hope it is the correct way.
Without the patch
Go to
admin/settings/wysiwyg_imageupload
change Styles (even one description to the left or add one more)
Save configuration
If you go to
admin/reports/status
and then return to
admin/settings/wysiwyg_imageupload
the Styles return to default.
Apply the patch.
At the end the Styles are the ones with the changes.
Comment #2
eugenmayer commentedwell i dont think thats the (100%) correct approach. There might be installation where the admin does not want to have any styles available.
So it rather hard to detect how to migrate. My best guess here is never touching it except on the install hook.
What do you think?
Comment #3
eletre commentedThe function wysiwyg_imageupload_requirements($phase) is called every time someone goes to the page admin/reports/status, not during installation.
I don't know why the variable wysiwyg_imageupload_imgstyles is also set in this function.
If you need to do so must be careful not to overwrite it.
Perhaps it is enough just to set it in the install function (_wysiwyg_imageupload_install_styles_if_missing()).
In any case it is important that the saved settings in the administration are not overwritten.
In this way, both the admin who wants the style and the admin who does not want them, can add or remove styles in the admin page, with the certainty that nobody will restore the default styles.
If there are not special reasons I left the creation of the variable only on the install hook.
Comment #4
eletre commentedThis is the second patch.
I removed variable_set from function wysiwyg_imageupload_requirement.
Comment #5
eugenmayer commentedpatched for the next 2.9 release. Thanks!
Comment #6
eletre commentedIt was a pleasure to be useful. Thanks for using my patch.
Comment #7
eugenmayer commentedreleased with 2.9