gavinwebb
Member
Posted 4 months ago #
Hi. I discovered this plugin before Christmas and had a little play with it, and was quite excited.
However, I've noticed today that when inserting an image into a post via the Media dialogue box, the 'Insert into Post' button has disappeared, and has been replaced with 'Insert into field', making it impossible to add the images.
I deactivated all plugins except Magic Fields 2, but the problem persists.
I have a couple of screenshots, but don't know how to insert them into the forum.
Thanks.
Gavin.
http://wordpress.org/extend/plugins/magic-fields-2/
I have the same issue... and noticed it a while ago. I was hoping it would be fixed by now. Any update on this?
Many thanks.
Dasha
yianniy
Member
Posted 4 months ago #
My fix:
(Not totally tested, but it will probably get you quite a bit along the way)
- create a copy of mf_admin.js called mf_media.js
- in mf_media.js keep only the load_link_in_media_upload function and the jQuery function after
//load button for image media
- in mf_admin.js get rid of these to pieces of code
- in main.php add the following lines of code after line 193
if( isset($_GET['mf_action']) && $_GET['mf_action'] == 'media_upload' ) {
wp_enqueue_script( 'mf_media',MF_BASENAME.'js/mf_media.js', array( 'jquery.validate', 'jquery.metadata', 'jquery' ) );
}
- in image_media_field.php change line 111 to
$link = sprintf('media-upload.php?post_id=0&type=image&mf_action=media_upload&TB_iframe=1');
A quick explanation of what is going on.
For whatever reason MagicFields-2 was loading its js on all admin pages, so when you load the media uploader it modifies the Insert button with jQuery.
By changing image_media_field.php you add an mf_action to the get string when MagicFields calls the media uploader.
By changing main.php you enqueue the javascript (mf_media.js now) that changes the upload form only if the
the mf_action=media_upload is set.
Hi, you can update a devel version https://github.com/magic-fields-team/Magic-Fields-2 and tell me if work fine for update this version in wordpress.org
pabline
Member
Posted 4 months ago #
Hi,
I've installed that development version, and it does fix the problem.
Cheers,
Paul.
gleenk
Member
Posted 4 months ago #
It seems to work with fix... Please update it on wordpress.org repository thank you
gavinwebb
Member
Posted 4 months ago #
Hello. This seems to have fixed the problem. Thanks.