Opened 4 days ago
Last modified 5 hours ago
#65302 new defect (bug)
Model Window Insert Media Insert button not visible on default color scheme
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.0.1 | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | General | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
Hi
The Model Media select window "Select Image" button disappears on the default color screen when a image is selected.
See attached images
Please provide a fix
Thank you
Attachments (5)
Change History (10)
#1
@
3 days ago
- Keywords reporter-feedback added
I've tested in both the default editor and using the classic editor plugin and can't replicate this. @neo2k23 Can you please ensure this issue is present while using a default theme and without any plugins active and also provide clear steps to reproduce (you may want to consider making and uploading a screen recording if that is easier)
#2
@
3 days ago
The theme uses this code
https://mikejolley.com/blog/2012/12/21/using-the-new-wordpress-3-5-media-uploader-in-plugins/
Btw It does not happen when you select another color scheme for the user. It only happens in the default color scheme.
Does that set you in the correct direction?
The theme is using this code.
var file_frame;
jQuery('.theme-add-media-button').on('click', function( event ){
var button = $(this);
var target = button.data('target');
var return_id = button.data('return_id');
var media_type = button.data('media_type');
if (typeof media_type === 'undefined'|| media_type==null || typeof media_type == 'string' && !media_type.trim()) media_type='image';
if (typeof return_id === 'undefined'|| return_id==null || return_id!=false && return_id!=true) return_id=true;
//button.blur();
button.trigger('blur');
event.preventDefault();
// If the media frame already exists, reopen it.
//if ( file_frame ) {
//file_frame.open();
//return;
//}
// Create the media frame.
file_frame = wp.media.frames.file_frame = wp.media({
title: jQuery( this ).data( 'uploader_title' ),
library: { type : media_type },
button: {
text: jQuery( this ).data( 'uploader_button_text' ),
},
multiple: false // Set to true to allow multiple files to be selected
});
file_frame.on( 'select', function() {
attachment = file_frame.state().get('selection').first().toJSON();
imagewidth = $('#'+target+'_preview').attr('data-imagewidth');
if(parseInt(attachment.width,10)<parseInt(imagewidth,10)){
imagewidth = attachment.width;
}
if($("#"+target).length>0){
if (media_type.toLowerCase().includes('video')) {
if (return_id===true) $("#"+target).val('{"type":"attachment_id","value":"'+attachment.id+'"}');
else $("#"+target).val('{"type":"attachment_url","value":"'+attachment.url+'"}');
$("#"+target+"_preview").html('<div class="thickbox"><figure class="wp-block-video"><video autoplay controls loop muted src="'+attachment.url +'" style="width:100%;max-width:240px;height:auto;"></video></div></figure>');
} else {
if (return_id===true) $("#"+target).val('{"type":"attachment_id","value":"'+attachment.id+'"}');
else $("#"+target).val('{"type":"attachment_url","value":"'+attachment.url+'"}');
$("#"+target+"_preview").html('<a class="thickbox" href="'+attachment.url+'?"><img width="'+imagewidth+'" src="'+attachment.url+'"/></a>');
}
}
});
file_frame.open();
});
#3
@
44 hours ago
- Milestone changed from Awaiting Review to 7.0.1
This issue is similar to #64840, where the fallback value for the default primary color might not be applied correctly. There might be a case where the fallback is not applied.
@neo2k23, Is it possible to download the theme where the issue is occurring so we can investigate it?
#4
@
41 hours ago
@wildworks Please checkout your direct message on slack.
Btw it looks like exact the same issue https://core.trac.wordpress.org/ticket/64840
but the base styles are enqueued. If i select a another color scheme for the user there is no issue and the button shows. It is only in the default wordpress color scheme which is set by default to the user
Select Image button gone if image is selected