WordPress.org

Ready to get started?Download WordPress

Forums

Magic Fields 2
'Insert into Post' changes to 'Insert into field' (7 posts)

  1. gavinwebb
    Member
    Posted 2 years 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/

  2. dashaluna
    Member
    Posted 2 years ago #

    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

  3. yianniy
    Member
    Posted 2 years ago #

    My fix:
    (Not totally tested, but it will probably get you quite a bit along the way)

    1. create a copy of mf_admin.js called mf_media.js
      1. in mf_media.js keep only the load_link_in_media_upload function and the jQuery function after //load button for image media
      2. in mf_admin.js get rid of these to pieces of code
    2. 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' ) );
      	  }
    3. 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.

  4. hunk
    Member
    Plugin Author

    Posted 2 years ago #

    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

  5. pabline
    Member
    Posted 2 years ago #

    Hi,

    I've installed that development version, and it does fix the problem.

    Cheers,

    Paul.

  6. gleenk
    Member
    Posted 2 years ago #

    It seems to work with fix... Please update it on wordpress.org repository thank you

  7. gavinwebb
    Member
    Posted 2 years ago #

    Hello. This seems to have fixed the problem. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic