From: Chris W. <ch...@cw...> - 2002-11-06 12:58:40
|
On Wed, 2002-11-06 at 06:48, Neemann, Thomas, D22K-MSN wrote: > Hello there. > > I've got a strange problem with the latest OpenInteract version: > > The version worked fine for many weeks, but now if SPOPS creates a new > record in the Database, it creates 3 entries ! The right one an two empty > records. > > I have nothing changed at the root system. The only thing I can think of is in the FAQ (entry below) Chris --------------- QQQQQQQQQQ I edited a (news|classified|random) item and OpenInteract saved my changes but created a new (and empty) record at the same time. AAAAAAAAAA You probably refer to an image in the resulting display page that is in the same directory. Therefore OI tries to load the page twice -- once for your actual submission, and then once for the image (since it's in the same directory). For example, we'll use the 'news' package. When you edit a news item you'll go to the URL '/News/edit/' with your edits POSTed. Now, say you edited your base template like so: Template: base_theme::base_main ======================================== <html> <head><title>[% page.title %]</title></head> <body> <img src="my_logo.jpg"> [% page.content %] </body> </html> ======================================== (Obviously this is a very slimmed-down template!) What will happen when the page gets loaded is the browser will be at the URL '/News/edit/' and see the 'src="my_logo.jpg"'. Because this is a relative URL, it will then ask the webserver for the image at '/News/edit/my_logo.jpg'. This request is mapped to the same OI handler as before, and because there aren't any restrictions on content (e.g., we don't test to see if there's a news item or title before saving) OI happily creates an empty news item. Solution: Use concrete URLs for your images, particularly using something at the top-level 'src="/images/blah.jpg"' since that's easier to capture by the static front-end proxy server. -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |