Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 18:22
    Matthew
    1

    move media items in bulk or drag and drop, add folder picker to MMP uploader?

    in v.7.1.1, am I missing something?  It doesn't seem possible to move/manage media items in bulk, either by selecting a range of items or by drag and dropping them, to another folder or the trash.

    also, when uploading with the multi media picker, it appears you can add a folder on the fly to /media but not pick an existing folder.  if you enter the name of an existing folder, i think it creates a duplicate folder w/(n) extension.

    it's pretty easy to accidently upload 20 images to the wrong folder, is there no quick way to fix the mistake?

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 21:20
    Matthew
    0

    Ah, I see that you can pick folders from the MMP, they were just way down below the images that got into /media.

    Still would like a way to drag/drop or multiple select or some quicker/easier way to manage them than: r-click > 'move' > click > 'move' > ok; repeat.

    Not a biggie for a couple images but bad upload for a gallery makes for a lot of work.

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 21:27
    Matthew
    0

    This is odd, I just moved all but one image from one folder to another and that last one shows up like some kind of banner crop, although none were ever done on that image or to anything in that folder.  The other images/folders still look fine.

    edits: that is when selecting the containing folder, when selecting the image itself, it looks fine. 

    another wide one like that also shows up at the bottom of the folder to which the rest of the images were moved, a different image.

    tried to delete the one in the first folder, now i still see it listed as in the folder but when you select it, nothing shows up.  the one in the other folder as also turned into a listing but no real image.  so it looks like the folder contents view thinks it's there but it isn't.

     

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 21:30
    Matthew
    0

    enter image description here

  • Craig100 1136 posts 2523 karma points c-trib
    Apr 19, 2014 @ 21:42
    Craig100
    0

    How deep is your media tree? Are you just moving images between top level folders or can you move images between sub-folders?

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 21:46
    Matthew
    0

    I started with one top level folder and one inside that but after moving several, i realized it would be quicker to move the second level folder to a top level so I would save a click opening the top folder to get to the second one.  didn't notice anything was wrong until i got to that last one.

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 21:47
    Matthew
    0

    enter image description here

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 21:51
    Matthew
    0

    deleting them has made them go away entirely though, so no harm, no foul.

  • Matthew 138 posts 201 karma points
    Apr 19, 2014 @ 22:29
    Matthew
    1

    ok, I see I missed the whole 'list view' concept: go into settings, media types and on folder, structure tab, enable list view.

    that at least gives you the option to mass delete things that ended up in the wrong place. you can't move them but you could delete then re-upload to the right place.

    I've never done any customizations to media type settings, looks like a whole new world opens up there....

  • Nigel 23 posts 78 karma points
    Nov 20, 2015 @ 12:52
    Nigel
    2

    I had a media folder with 3000+ images on the root , so just created a folder for each year and ran this update for each folder

    UPDATE umbracoNode
        SET parentID='19607', level=2, path = '-1,19607,'+ CAST(id AS varchar(50))
        WHERE   (YEAR(createDate) = '2015') and  (parentID = '-1') and  (level=1)  and  (nodeObjectType = 'b796f64c-1f99-4ffb-b886-4bf4bc011a9c')
    

    I started to update the cmsContentXML but realized it wasn't required

     if object_id('tempdb..#tmp', 'u') is not null
    DROP TABLE #tmp
    
    DECLARE @nodeId varchar(255)
    SELECT @nodeId = '1326' 
    
    DECLARE @parentID varchar(255)
    SELECT @parentID = '1801' 
    
    --CREATE TABLE #tmp(Id int,DocXml xml)  -- select target records into tempdb
    SELECT nodeId, CAST([xml] AS xml) AS DocXml INTO #tmp FROM cmsContentXml WHERE nodeId = @nodeId;
    
    DECLARE @newValue varchar(255)
    SELECT @newValue = '-1,' 
    + @parentID
    + ','
    + (SELECT CAST(nodeId AS varchar(50)) FROM #tmp);
    
    -- update tempdb
    UPDATE #tmp SET DocXml.modify('replace value of (/Image/@parentID)[1] with (sql:variable("@parentID"))');
    UPDATE #tmp SET 
    DocXml.modify('replace value of (/Image/@level)[1] with "2"');
    UPDATE #tmp SET 
    DocXml.modify('replace value of (/Image/@path)[1] with (sql:variable("@newValue"))');
    
    -- and copy back to original table
        UPDATE cmsContentXml
           SET xml = CAST(U.DocXml AS nvarchar(MAX))
          FROM dbo.cmsContentXml TT
    INNER JOIN #tmp U ON TT.nodeId = U.nodeId;
    
    SELECT * FROM cmsContentXml  WHERE nodeId = @nodeId;
    
  • Christopher Pascual 27 posts 275 karma points
    Dec 07, 2017 @ 08:13
    Christopher Pascual
    0
    UPDATE umbracoNode
        SET parentID='19607', level=2, path = '-1,19607,'+ CAST(id AS varchar(50))
        WHERE   (YEAR(createDate) = '2015') and  (parentID = '-1') and  (level=1)  and  (nodeObjectType = 'b796f64c-1f99-4ffb-b886-4bf4bc011a9c')
    

    Lifesaver , Many thanks.

  • Anders Brohäll 295 posts 561 karma points c-trib
    Mar 26, 2019 @ 16:09
    Anders Brohäll
    0

    I adjusted it to only affect Images.

    DECLARE @destinationFolderId varchar(6) 
    DECLARE @year varchar(4) 
    
    SET @destinationFolderId = '45189'
    SET @year = '2019'
    
    SELECT 
        umbracoNode.id 
        INTO #tempIds 
        FROM umbracoNode
            INNER JOIN cmsContent ON umbracoNode.id = cmsContent.nodeId
            RIGHT JOIN cmsContentType on cmsContent.contentType = cmsContentType.nodeId
        WHERE 
            (
                YEAR(createDate) = @year) 
                AND (parentID = '-1') 
                AND (level=1) 
                AND (nodeObjectType = 'b796f64c-1f99-4ffb-b886-4bf4bc011a9c' -- = Constants.ObjectTypes.Media
            )
            AND cmsContentType.alias = 'Image' -- Only take Images
    BEGIN TRAN
    UPDATE 
        umbracoNode
        SET 
            parentID=@destinationFolderId, 
            level=2, 
            path = '-1,'+ @destinationFolderId + ','+ CAST(id AS varchar(50))
        WHERE  umbraconode.id 
            IN ( SELECT id FROM #tempIds )
    
    DROP TABLE #tempIds
    --COMMIT TRAN
    ROLLBACK TRAN
    

    Uncomment the --COMMIT TRAN to execute the transaction :)

Please Sign in or register to post replies

Write your reply to:

Draft