Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » imported images disappear in database :/

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1046 Views
  • PaweÅ‚ PierzchaÅ‚a
    Community Member
    5 Posts

    imported images disappear in database :/ Link to this post

    i was supposed to import (from postgres db) some objects and images to SS. I did it and objects (hotels) work fine, but i have problem with images, they work fine till someone goes into 'Files and images' in CMS, after that records withy imported images in mysql database disappear.

    I guess that i imported data and inserted them not to all required table.

    What i did (in each step):
    INSERT INTO File(ID,ClassName,Name,Title,Filename,ParentID,OwnerID) VALUES($actNumber,'Image','".$name1Got."','".$name1Got."','assets/".$rowP['photo1']."',8,1)

    (at the end values 8 and 1, because i found out that cms automatically gives that values to that files)

    UPDATE HotelSPA_Live SET Photo1ID = ".$actNumber." WHERE ID = ".$got['ID']."

    UPDATE HotelSPA SET Photo1ID = ".$actNumber." WHERE ID = ".$got['ID']."

    same thing for another 5 photos and then another step for another object

    and as I said: works fine till somone goes into 'photo and files' in cms and (not sure that) when somone adds images in cms (from right menu).
    I see that photos are loaded in cms (got option for delete or replace), but i don't see them, 'cause they're not in database (let's say objects had ID from 300 to 500, now new Id starts from 501)

    What should I do to avoid that king of problem ?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.