Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Undefined offset?
Avatar
Michael Yakutis
Member
Free Members
sp_UserOfflineSmall Offline
Jun 20, 2014 - 6:40 pm

I'm getting the following errors above some of my forum threads:

Undefined offset: 1 in webcomicunderdogs.com/wp-content/plugins/simple-press/sp-api/sp-api-filters.php on line 1749

Here's what's on line 1749:

return '<img src="'.$src[1].'"'.$display_width.$display_height.' title="'.$title[1].'" alt="'.$alt[1].'" />';

Any ideas why this notice is cropping up? Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 20, 2014 - 10:22 pm

its not an error...  its a notice (harmless)...  and you really shouldnt be displaying notices, warnings or errors on a production site...  you should turn them off in php...

that said, not sure what the issue is...  is the image in the post valid html?

Avatar
Michael Yakutis
Member
Free Members
sp_UserOfflineSmall Offline
Jun 20, 2014 - 11:05 pm

Sorry, I meant "notice". I didn't know I could turn them off in php - I'll have to look into that. The notice seems to appear in image-heavy threads, so one of them must be setting it off.

Avatar
Michael Yakutis
Member
Free Members
sp_UserOfflineSmall Offline
Jun 20, 2014 - 11:58 pm

I can't seem to figure this out - can you tell me how to keep notices from displaying? 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 21, 2014 - 3:24 am

It is set in your php.ini file. If you are in control of the php.ini file the easiest thing to do is open it, search for, say, E_NOTICE, and then read the comments in the error reporting section and change the settings to suit. It will usually have good examples of what to set for a production, live site v what to set for development, private use.

As you the notice you are getting, are any of the images missing or messed up?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Michael Yakutis
Member
Free Members
sp_UserOfflineSmall Offline
Jun 21, 2014 - 5:44 pm

I looked through the threads in question, and can't locate any missing or messed up files. But, perhaps I don't know what to look for. Here's one of the image-heavy threads: http://www.webcomicunderdogs.c.....work-space

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 21, 2014 - 6:52 pm

my guess is its this post:  http://www.webcomicunderdogs.c.....ace/#p4112

two warnings and that has two images.. plus its form a tinypic site, so it might be returning/blocking requests for the file image size...  might be a cdn or cache of some sorts...  and oddly the images have a link to the same image...  kind of confusing...

biggest problem is the notice message isnt helpful...  as you can see in the code, several items have an index of 1 referenced.. we can see about adding some special guards, but that info should really be there...

and you should block those notice, warning and error displays on your production site... its done in your php.ini file...

Avatar
Michael Yakutis
Member
Free Members
sp_UserOfflineSmall Offline
Jun 21, 2014 - 8:28 pm

I wish I could, but I have no idea how to block the notices. After not being able to locate the php.ini file, I did some research but could not figure out how to locate it. Numerous places suggest creating the file yourself, which does not make sense to me. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 21, 2014 - 9:03 pm

check with your host - they will know...  do you not have some sort of control panel, like cpanel?

also in your wp-config.php, try adding these settings:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);

Avatar
Michael Yakutis
Member
Free Members
sp_UserOfflineSmall Offline
Jun 21, 2014 - 9:59 pm

I was told by a developer:

"If you really want to get rid of the errors (note that this is like turning off your body's pain receptors, if something serious were to happen), you can insert these lines in wordpress-config.php
 

error_reporting(0);

@ini_set('display_errors', 0);"
 
So I am hesitant to add these settings to wp-config. Does this concern have any merit?
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626