When embedding an image the choices for Display As should be Default, Preview and Teaser.
They appear as Oefault, Queaser and Treview.

Replicated in base wetkit4.9

Some environments throw this warning:

php Warning: Illegal string offset 'label' in wetkit_images_media_wysiwyg_allowed_view_modes_alter() (line 49 of profiles/wetkit/modules/custom/wetkit_images/wetkit_images.module).

This is resolved by changing the case in lines 43,44 and 45 to Initial caps.
I am attempting to create a patch.

37 /**
38 * Implements hook_media_wysiwyg_wysiwyg_allowed_view_modes_alter().
39 */
40 function wetkit_images_media_wysiwyg_allowed_view_modes_alter(&$options, $context) {
41 if ($context->type == 'image') {
42 // Relabel some options
43 $labels = array(

44 - 'default' => t('Original Size'),
45 - 'teaser' => t('Quarter Size'),
46 - 'preview' => t('Thumbnail'),

44 + 'Default' => t('Original Size'),
45 + 'Teaser' => t('Quarter Size'),
46 + 'Preview' => t('Thumbnail'),

47 );
foreach ($labels as $name => $label) {
if (isset($options[$name])) {
$options[$name]['label'] = $label;
}
}
}
}

Files: 
CommentFileSizeAuthor
#2 illegal_string_offset-2761543-2.patch833 bytessylus

Comments

fgjohnson created an issue. See original summary.

sylus’s picture

Status: Active » Fixed
FileSize
833 bytes

Added an additional check for the label. Not sure what changed in contrib that caused this to be an issue now but fix will be in next release.

Also attached a patch.

fgjohnson’s picture

Issue summary: View changes
fgjohnson’s picture

Thanks.
You are faster at patch creation than me! :-)

  • sylus committed 371c7a2 on 7.x-4.x
    Fixed WetKit Images for Issue #2761543: Illegal string offset adding...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.