Posting pictures on posts generates 8 errors

Nao

  • Dadman with a boy
  • Posts: 15,932

Farjo

  • "a valuable asset to the community"
  • Posts: 490

txcas

  • Bug Zapper
  • Posts: 202

Nao

  • Dadman with a boy
  • Posts: 15,932
Re: Posting pictures on posts generates 8 errors
« Reply #18, on June 20th, 2014, 12:31 PM »
@Farjo, I tend to forget that mentions also trigger a notification... :^^;:

@txcas, how exactly can it be fixed, when I didn't do anything for that, precisely because I was waiting for some feedback from you..?

:edit: Then if it's still there (™), why don't you follow the link I gave you..?

txcas

  • Bug Zapper
  • Posts: 202
Re: Posting pictures on posts generates 8 errors
« Reply #19, on June 20th, 2014, 03:05 PM »
I thought it was fixed because I posted 5 pictures and the error log did not show anything.  But after refreshing the page, there they were, 40 errors.  @Nao isn't the link just pointing to this post?  Let me know what you need and I get it for you.

Nao

  • Dadman with a boy
  • Posts: 15,932

txcas

  • Bug Zapper
  • Posts: 202
Re: Posting pictures on posts generates 8 errors
« Reply #21, on June 20th, 2014, 04:30 PM »
I must be doing something wrong.  As soon as I add that line to errors.php the forum stops working.  This is what I have:

Code: [Select]
function log_error($error_message, $error_type = 'general', $file = null, $line = null, $referrer = null)
{
global $settings, $last_error, $context;
static $plugin_dir = null;

// Check if error logging is actually on.
if (empty($settings['enableErrorLogging']))
return $error_message;

// Windows does funny things. Fix the pathing to make sense on Windows.
if ($plugin_dir === null)
$plugin_dir = DIRECTORY_SEPARATOR === '/' ? ROOT_DIR . '/plugins' : str_replace(DIRECTORY_SEPARATOR, '/', ROOT_DIR . '/plugins');

//Added to debug picture posting errors
if (is_array($error_message)) { log_error(print_r($error_message, true); }

// Basically, htmlspecialchars it minus & (for entities!); also save simple links.
$error_message = strtr($error_message, array('<' => '&lt;', '>' => '&gt;', '"' => '&quot;'));
$error_message = strtr($error_message, array('&lt;br&gt;' => '<br>', '&lt;b&gt;' => '<strong>', '&lt;/b&gt;' => '</strong>', "\n" => '<br>'));
$error_message = preg_replace('~&lt;a href=&quot;(.*?)&quot;&gt;(.*?)&lt;/a&gt;~', '~<a href="$1">$2</a>~', $error_message);

Nao

  • Dadman with a boy
  • Posts: 15,932
Re: Posting pictures on posts generates 8 errors
« Reply #23, on June 21st, 2014, 01:24 AM »
Okay, so...

Code: [Select]
if (is_array($error_message))
$error_message = serialize($error_message);

$error_message .= "\n\n" . debug_backtrace(false);

Now it should work, and should give me more interesting results when you get your errors! :)
Once you get a backtrace log, only reproduce the first one here. I guess the following ones will be the same, anyway...

Farjo

  • "a valuable asset to the community"
  • Posts: 490

txcas

  • Bug Zapper
  • Posts: 202
Re: Posting pictures on posts generates 8 errors
« Reply #26, on November 20th, 2014, 05:52 PM »
We debug code in errors.php I getting these:

Code: [Select]
http://www.65creedmoor.com/?action=media;sa=post;noh=message
8: Undefined index: doc
Array
File: /home/creedmoo/public_html/gz/app/media_Aeva-Gallery.php
Line: 1583
________________
http://www.65creedmoor.com/?action=media;sa=post;noh=message
8: Undefined index: doc
Array
File: /home/creedmoo/public_html/gz/app/media_Aeva-Gallery.php
Line: 1487

The errors repeat for audio and video.

Nao

  • Dadman with a boy
  • Posts: 15,932