Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Popup shows homepage after save - example code


Go to End


9 Posts   3284 Views

Avatar
MikeOne

Community Member, 40 Posts

2 October 2009 at 12:53am

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.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 October 2009 at 1:26am

Check for javascript errors.

Avatar
MikeOne

Community Member, 40 Posts

2 October 2009 at 2:12am

Edited: 02/10/2009 2:13am

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

Avatar
MikeOne

Community Member, 40 Posts

2 October 2009 at 3:15am

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 October 2009 at 3:20am

You got a link I can test?

Avatar
MikeOne

Community Member, 40 Posts

2 October 2009 at 3:31am

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?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 October 2009 at 4:29am

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

Avatar
MikeOne

Community Member, 40 Posts

2 October 2009 at 5:26am

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.

Go to Top