Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
entering article images that doesnt exist
I accidentally entered a article image id that didn’t exist and my blog went blank! Is this the default behaviour? Isn’t there a way to test to see if the image actually exists and the bail nicely?
Offline
Re: entering article images that doesnt exist
Hmmm that’s new … in admin make sure in “admin > basic > production status” is set to live … then nothing like that should happen …
I tried with debugging/testing/live in 4.04 on my site … and site shows up in all cases but lot of broken messages in first two…
nuff-respec ::: dannyb
Offline
#3 2007-02-24 00:57:17
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: entering article images that doesnt exist
FAQ: How should I ask for help on the forum?
What does “went blank” mean? Change your production mode to Testing/Debugging. Do you get any error messages?
Offline
Re: entering article images that doesnt exist
Mary wrote:
What does “went blank” mean? Change your production mode to Testing/Debugging. Do you get any error messages?
I have my site set up to debugging and I just get an totally empty page (no output). also the error log doesn’t say anything.
I’m using PHP 5.2.1
Offline
#5 2007-02-24 12:36:37
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: entering article images that doesnt exist
And this was just a ID number for an image that doesn’t exist?
I’ve no idea why that would happen, but it definitely should not.
The next thing is to examine exactly what page and forms that article is using. Put an id for an image that does exist, then post a tag trace.
Offline
Re: entering article images that doesnt exist
Mary wrote:
And this was just a ID number for an image that doesn’t exist?
I’ve no idea why that would happen, but it definitely should not.
The next thing is to examine exactly what page and forms that article is using. Put an id for an image that does exist, then post a tag trace.
I’m running PHP 5.2.1. Could that mean anything?
I cant post a tag trace since I’m not getting any page back. I’m simply getting a completly blank page. Nothing in view source.
HEAD http://blablabla.bla/blog/6/test
500 Server closed connection without sending any data back
Content-Type: text/plain
Client-Date: Tue, 27 Feb 2007 10:27:07 GMT
Client-Warning: Internal response
Last edited by gemal (2007-02-27 10:28:08)
Offline
Re: entering article images that doesnt exist
I think I found the problem:
In line: http://dev.textpattern.com/browser/development/4.0/textpattern/publish/taghandlers.php#L2060
$rs = safe_row(‘*’, ‘txp_image’, ‘id = ‘.intval($image));
this is NOT return empty on my system. It’s returning:
Array()
so:
$rs = safe_row(‘*’, ‘txp_image’, ‘id = ‘.intval($image));
if ($rs)
will validate to true!
Offline
#8 2007-02-27 19:24:04
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: entering article images that doesnt exist
this is NOT return empty on my system. It’s returning:
Array()… will validate to true!
No, an empty array evaluates to zero/false.
I cant post a tag trace since I’m not getting any page back.
You didn’t read that properly (further emphasis added):
Put an id for an image that does exist, then post a tag trace.
Offline
Re: entering article images that doesnt exist
Mary wrote:
bq. this is NOT return empty on my system. It’s returning:
Array()… will validate to true!
No, an empty array evaluates to zero/false.
Sorry you’re right. The problem is in the trigger_error.
http://dev.textpattern.com/browser/development/4.0/textpattern/publish/taghandlers.php#L2113
not sure why, but having that line makes my php return an empty page.
Offline
#10 2007-02-28 21:23:46
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: entering article images that doesnt exist
What page(s) show as blank? Just the individual article page or others too?
Alex
Offline