GD creating multiple images each time on import of categories

This topic contains 12 replies, has 3 voices, and was last updated by  Kiran 5 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #535006

    lmj-temp
    Expired Member
    Post count: 5

    Hi,

    Just working through the setup of GD and started with categories. We have about 20 parent categories and each has 0-12 subcategories. For now we want to use the same category default images for each of the subcategories as their parent. Same with the category icons. When we export the category info we see that GD has created separate files for each subcategory in both of those cases and also those “copied” files are in the uploads area. We don’t want to maintain thousands of those “copied” images; some day they might be unique but maybe never.

    Also, each time we re-import the csv through the built-in import (not WP Import) it creates yet another batch of these “copied” files with new file names. Other fields don’t seem to duplicate on importing.

    Also, after reading a couple other support posts here it appears we may run in to the same problem with listing images??

    Is there a method that can be used to only have one copy of these in GD including after importing multiple times?

    #535030

    Alex Rollin
    Moderator
    Post count: 27815

    For categories you can name a file in wp-content/uploads with a URL and it will not be imported. Try that and let us know.

    Listing images are always imported, whether specified as a URL or a filename. We recommend that at least the first image is a URL so that it can be used to create thumbnails.

    About listings, though, you don’t load the default image to the listing itself. Default listings images are one of the fallbacks:

    https://wpgeodirectory.com/docs-v2/design/images/#fallback

    https://wpgeodirectory.com/docs-v2/geodirectory/settings/import-export/#faq

    If I missed part of your question please write back and clarify.

    #535042

    lmj-temp
    Expired Member
    Post count: 5

    Hi Alex,

    I get the duplicating even when re-importing the exact file I export. It has the files referenced by wp-content/uploads URL already; isn’t that the format you are refering to? The URLs below were taken direct from the export file; the first entry is the parent category and the three below that are subcategories of that one; they were all set to the same URL and file name as the parent when we first started importing and exporting. We have done that round-trip 4 times now as we are trying to figure this out and as you can see the GD system keeps creating “copied” versions and making new files. The prior ones always remain in the uploads folder seemingly abandoned as they are no longer referenced in GD. It does not duplicate the parent image files though. We don’t want GD to enumerate these images as unique files for each subcategory; how do we stop that?

    http://localhost/LMJ-temp/wordpress/wp-content/uploads/2020/03/Medical-Category-Default-Image.jpg
    http://localhost/LMJ-temp/wordpress/wp-content/uploads/2020/03/Medical-Category-Default-Image-10.jpg
    http://localhost/LMJ-temp/wordpress/wp-content/uploads/2020/03/Medical-Category-Default-Image-11.jpg
    http://localhost/LMJ-temp/wordpress/wp-content/uploads/2020/03/Medical-Category-Default-Image-12.jpg

    #535055

    Alex Rollin
    Moderator
    Post count: 27815

    I will ask the developers to comment on your case.

    #535078

    Kiran
    Moderator
    Post count: 7069

    Hello There,

    Can you provide us .csv file that you are trying to import? Please attach .csv file in zip format.

    Thanks,
    Kiran

    #535135

    lmj-temp
    Expired Member
    Post count: 5
    This reply has been marked as private.
    #535233

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks,

    please also share WP Admin credentials so we can check out the issue on your site.

    #535298

    lmj-temp
    Expired Member
    Post count: 5
    This reply has been marked as private.
    #535406

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    The developers and I discussed the upload of the same image for the default image for multiple categories.

    This is not possible through the importer – it will, by design, create an independant image for each category.

    The main reason for this is that, if the image is deleted, it won’t disappear for more than one category at a time.

    #535438

    lmj-temp
    Expired Member
    Post count: 5

    Hi Alex,

    OK, That process of the system creating an additional one for each subcategory is something that I could live with but why does it create new ones every time we do an import when the referenced file is already in the correct folder? Is there a method to stop creating new ones after the initial load if they haven’t changed?

    #535465

    Alex Rollin
    Moderator
    Post count: 27815

    When you update, are you exporting first? Because if the unique image exists then it shouldn’t do that. For example if logo-2 is created, then logo-2 will be set for the image link. Are you using that? Or still trying to upload ‘logo’ again?

    #535625

    lmj-temp
    Expired Member
    Post count: 5

    Hi Alex,

    I am exporting the file and then, with no edits, re-importing it again. The GD system creates new image files for all but the parent categories. I see the files in the normal GD folder along with all the other GD related listing images. Can you confirm when you try that test, on an install you have there, that you do not see the same duplication?

    #535675

    Kiran
    Moderator
    Post count: 7069

    Hello lmj-temp,

    I have done some more testing on my test site.

    I have created two categories.
    – Added a parent category named “Category A” & uploaded image “category-a.png” & icon “category-i-a.png”
    – Added a child category named “Category A A” under “Category A” & uploaded image “category-a-a.png” & icon “category-i-a-a.png”
    – Exported those categories in csv
    – Re-imported csv
    – It worked as expected. There is no new attachment entry created in database or in folder.

    Check csv file in attachment.

    Let us know.

    Regards,
    Kiran

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount