Support » Plugin: WP/LR Sync (Lightroom Sync) » Not adding image to RML folder

  • Resolved opicron

    (@opicron)


    Great plugin, will use with a lot of joy!

    I have everything set up. Created collections in LR and they show up in WordPress in de RML structure.

    However images added to these collection in LR do not show up under the folders in WordPress. The RML folder remains empty and the image is found under uncategorized.

    Am I doing something wrong? RML version 3.4.6 upgraded to version 4. Which is not reconized by wp/lr.

    • This topic was modified 1 year ago by  opicron.
    • This topic was modified 1 year ago by  opicron.
    • This topic was modified 1 year ago by  opicron.
Viewing 7 replies - 1 through 7 (of 7 total)
  • opicron

    (@opicron)

    I see that under Collections & Keywords the folder is set to ID:2. However in RML the RML folder is 46. Although, folder 2 does also exist but does not contain the images either.

    • This reply was modified 1 year ago by  opicron.
    Plugin Author Jordy Meow

    (@tigroumeow)

    Please update to the latest version of WP/LR Sync, it should be available at any minute now 🙂

    opicron

    (@opicron)

    I tried the new version but the images are not yet added to the folder. They remain in uncategorized.

    As an extra also now with the new version deleted files from LR are not removed in WP media.

    Plugin Author Jordy Meow

    (@tigroumeow)

    We’ll have to wait for Matthias for that, unfortunately 🙁 I am actually not using RML myself at this moment, and only provided the extension created by Matthias, but it seems he will fix it.

    opicron

    (@opicron)

    I added the following code to manually set the correct rml folder on upload. This works for me while an solution is made.

    // define the wp_generate_attachment_metadata callback 
    function my_set_rml_category( $metadata, $attachment_id ) { 
    
      	if ( current_user_can('importer') )
    	{
    	
    		$parentcatid = wp_rml_create_or_return_existing_id("Products", _wp_rml_root(), 0, array(), false, true);
    		if (!is_array($parentcatid))
    		{
    			$categoryid = wp_rml_create_or_return_existing_id("Lightroom", $parentcatid, 0, array(), false, true);
    		}
    		//$shortcut = true;
    	}
    
    	if (!is_array($categoryid))
    	{		  
    	  	$ids = array();
    	  	$ids[] = $attachment_id;
    		//var_dump($parentcatid);
    		//var_dump($categoryid);
    		wp_rml_structure_reset();
    	  	wp_rml_move( $categoryid, $ids, false, false );
    	}
    
        // make filter magic happen here... 
        return $metadata; 
    
    }; 
             
    // add the filter 
    add_filter( 'wp_generate_attachment_metadata', 'my_set_rml_category', 10, 2 );
    Plugin Author Jordy Meow

    (@tigroumeow)

    I have sent a message to Matthias, he will probably come here and comment 🙂

    opicron

    (@opicron)

    Much appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Not adding image to RML folder’ is closed to new replies.