Posting pictures on posts generates 8 errors

txcas

  • Bug Zapper
  • Posts: 202
Posting pictures on posts generates 8 errors
« on February 4th, 2014, 11:41 PM »
I finally figured out how to set the Media permissions so users can post pictures.  Pictures are getting posted correctly, but they generate eight errors:

8: Undefined index: doc
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1587

8: Undefined index: video
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
Line: 1587

8: Undefined index: audio
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1587

8: Undefined index: image
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1587

The above errors get repeated on line 1492.

Nao

  • Dadman with a boy
  • Posts: 16,013
Re: Posting pictures on posts generates 8 errors
« Reply #1, on February 4th, 2014, 11:45 PM »
"This never happened before!" (™®)

Nope, can't see why it would happen... What are your quota settings?
Can you do a print_r($q) before line 1471 in core/app/media/Aeva-Gallery.php?

txcas

  • Bug Zapper
  • Posts: 202
Re: Posting pictures on posts generates 8 errors
« Reply #2, on February 5th, 2014, 12:10 AM »
Quotas are set at default of 1024 KB using the default profile.  Is this what you want me to add to the code?
Code: [Select]
$albums = array();
$q = @$allowed_albums[$latest_album]['quota'];
print_r($q)
if (empty($q))

Nao

  • Dadman with a boy
  • Posts: 16,013

txcas

  • Bug Zapper
  • Posts: 202
Re: Posting pictures on posts generates 8 errors
« Reply #4, on February 5th, 2014, 04:18 PM »
That changed the errors to:

8: Undefined index: doc
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1588

8: Undefined index: video
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1588

8: Undefined index: audio
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1588

8: Undefined index: image
File: /home/creedmoo/public_html/sandbox/gz/app/media_Aeva-Gallery.php
 Line: 1588

And the same errors on line: 1493

I can create an admin account for you if you want to take a peek.

Nao

  • Dadman with a boy
  • Posts: 16,013
Re: Posting pictures on posts generates 8 errors
« Reply #5, on February 5th, 2014, 06:35 PM »
Well, didn't it show anything else in the web page..? Or are you copying this from the error log instead?
In which case, please replace `print_r($q);` with `log_error($q);` in the code I gave you! And try again... (No, I don't need the other errors :P)

txcas

  • Bug Zapper
  • Posts: 202
Re: Posting pictures on posts generates 8 errors
« Reply #7, on March 2nd, 2014, 04:13 PM »
Now that my site is live and members can load pictures to the album, I had over 400 of these errors yesterday.  The pictures are posting, the users see to errors, but we get these errors in the log.

Nao

  • Dadman with a boy
  • Posts: 16,013
Re: Posting pictures on posts generates 8 errors
« Reply #8, on March 27th, 2014, 10:56 PM »
My problem is not in hiding this error (heck it's easy as hell...), but in understanding why it happens in the first place.

I actually made a log_error debug process here and went through uploading pics, and didn't get any errors... OF COURSE.
Perhaps it works fine for admins, and not for others.

I have a feeling that this piece of code is executed twice, and that the problem occurs on phase 2. Other than that... I dunno.
Of course, I can simply just ignore the bug, and proceed with hiding the error. That'd give me more time to work on other things...
Re: Posting pictures on posts generates 8 errors
« Reply #9, on March 27th, 2014, 11:01 PM »
txcas, are you still getting the Errors.php error..? Because that one, I never got to see.

If yes, then please add, before line 39 in that file, something like:

Code: [Select]
if (is_array($error_message)) { log_error(print_r($error_message, true); }

Or this one (it's going to give a long array of esoteric data):

Code: [Select]
if (is_array($error_message)) { log_error(print_r(debug_backtrace(), true); }

Then check your error log, and repost your findings somewhere, either here or by PM... Thanks!
Note: I'm more interesting in the first version, but if $error_message is an empty array or something, then the second version will be the only one that gets me a proper way to debug.

Farjo

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

txcas

  • Bug Zapper
  • Posts: 202

Nao

  • Dadman with a boy
  • Posts: 16,013

Farjo

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

txcas

  • Bug Zapper
  • Posts: 202