Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Popup shows homepage after save - example code

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 2086 Views
  • MikeOne
    Avatar
    Community Member
    40 Posts

    Popup shows homepage after save - example code Link to this post

    Hi,

    I apologise if this has been beaten to death already before - however - I could not find this issue in the forum.

    I'm quite a newbie with SS and after finishing the 2 first tuts - I thought I had a go at DOM as this is exactly the module I need for an upcoming project.

    I'm using DOM r292..

    Going through the examples on http://doc.silverstripe.com/doku.php?id=modules:dataobjectmanager - I run into a small but annoying issue:

    I have been implementing the 'Testimonial' example and everything works beautifully, except that when I hit 'Save' in the pop-up window, the content of the popup window is being redirected to the homepage of the site (so basically 'localhost' on my test machine) instead of simply showing the expected 'Added new Testimonial successfully' (which I see when I subsequently add a new testimonial strangly enough..).

    I'm probably missing something very obvious but I can seem to find out what? Can someone point me in the right direction please?

    Many thanks,
    Michiel.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Popup shows homepage after save - example code Link to this post

    Check for javascript errors.

  • MikeOne
    Avatar
    Community Member
    40 Posts

    Re: Popup shows homepage after save - example code Link to this post

    Ok, that was a bit tricky as this is in a popup. So what I did -> rightclick in the popup-up -> open this frame in new Tab (Firefox). So the form is then in a new tab with firebug available (;-)) -> filled out the form, hit Save - and no javascript errors to be seen... it simply redirects to locahost..

    I'm lost..

    EDIT: PS - just to be clear - the record is correctly added so functionally it works fine..

  • MikeOne
    Avatar
    Community Member
    40 Posts

    Re: Popup shows homepage after save - example code Link to this post

    Ok, found out some more and now I'm not sure if this is a DOM specific issue I'm seeing.

    I checked out the NET console in Firebug so see what was happening on the 'Save' submit of the form..

    Failed to load source for: http://localhost/admin/EditForm/field/Testimonials/AddForm?ctf[Testimonials][start]=0&ctf[Testimonials][per_page]=10&ctf[Testimonials][showall]=0&ctf[Testimonials][sort]=SortOrder&ctf[Testimonials][sort_dir]=DESC&ctf[Testimonials][search]=&ctf[Testimonials][filter]=

    And then it redirects to localhost.. So something seems wrong with my Silverstripe install maybe? Is the path where the form tries to submit to correct in the first place?

    Please assist? I'm quite lost..

  • UncleCheese
    Avatar
    4085 Posts

    Re: Popup shows homepage after save - example code Link to this post

    You got a link I can test?

  • MikeOne
    Avatar
    Community Member
    40 Posts

    Re: Popup shows homepage after save - example code Link to this post

    I'm afraid not - I've only got it running locally

    I think I can rule out DOM though - I just finished the Staff section in Tutorial 2 where you add an image..
    In that (normal) image upload thingie, I get exactly the same behaviour when I submit the image.. it also load the homepage in the little Iframe there with the following error in the NET console:

    Failed to load source for: http://localhost/images/index/StaffPage/22/Photo/EditImageForm

    Any ideas?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Popup shows homepage after save - example code Link to this post

    Usually means you haven't checked off a radio button for from pc or upload.

  • MikeOne
    Avatar
    Community Member
    40 Posts

    Re: Popup shows homepage after save - example code Link to this post

    Not in this case I believe. I choose the upload from PC option, selected an image - and the actual upload worked fine - it just doesn't show me the confirmation message - it simply redirects the iFrame to the 'homepage'...

    Not sure what's wrong here but I'm now doing a fresh install on my VDS which is also available under a domain name so if I run into the same issue again - I can provide you with a URL.

    I'm starting to believe however that this might be an environment thing i.e. the PHP version on my specific (Mac OSX) OS that might be causing this strange behaviour. So running it of my VDS will proof if that's the case I guess (in that case the conclusion might be... do not try to run this of a Mac ;-)).

    Thanks for your help so far - I might get back to this issue if I run into it again on my server.

    2086 Views
Page: 1 2
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.