Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Uploadify Problems with Frontend Page Form

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 558 Views
  • MonkeyBen
    Avatar
    Community Member
    25 Posts

    Uploadify Problems with Frontend Page Form Link to this post

    I am building a frontend form that can be used to add news article pages to the database. I have managed to get the form to save the page data but when I try to add Uploadify for the has_many news images, the images go into the database correctly but it messes up the page data (e.g. news data only going in news_live table, classname being set to SiteTree, Created not set, URLSegment wrong, ParentID wrong).

    I have found that the news images and the news page data saves correctly, apart from the form just adding the page as a deleted page, when I use the $newsarticle->write() function so it looks like I either have something wrong or Uploadify has an incompatibility with the Versions extension (using writeToStage, publish).

    Thanks for any help

  • MonkeyBen
    Avatar
    Community Member
    25 Posts

    Re: Uploadify Problems with Frontend Page Form Link to this post

    I changed the code to as below and that works: -

    //$latestnewsarticle->writeToStage('Stage');
    //$latestnewsarticle->publish('Stage', 'Live');

    $latestnewsarticle->write();
    $latestnewsarticle->doRestoreToStage();

    The client wont be using the CMS, they will be using a custom backend.

    558 Views
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.