Advertisement:

Author Topic: A profile error - Undefined  (Read 4839 times)

Offline wynnyelle

  • SMF Hero
  • ******
  • Posts: 2,569
    • Warrior Cats RPG
Re: A profile error - Undefined
« Reply #20 on: January 25, 2012, 08:30:55 PM »
I detailed the problems with SimpleSEF's cache earlier on. I don't know for sure if it would properly re-enable afterwards so I've been reluctant to take a chance. If it fails to restore back to where it was before, not only are thousands of search engine links destroyed, but worse, the tens of thousands of roleplay networking links members have created in-site with each other, connecting their threads, etc. will also be irretrievably broken.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: A profile error - Undefined
« Reply #21 on: January 25, 2012, 08:45:08 PM »
OK, so now I'm confused by the new errors because they shouldn't be occurring (and they are a result of my changes, though that's ultimately because *I* made an assumption as well)

The first change, around line 52, should ultimately now become:
Code: [Select]
// Load all the members up.
$buddies = loadMemberData($buddies, false, 'profile');

$context['buddies'] = array();
if (count($buddies) > 0)
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['buddies'][$buddy] = $memberContext[$buddy];
}

Just like the other instances already are, actually.

The lag caused by SSEF is not that serious in the scheme of things - or shouldn't be.
No good deed goes unpunished
All helpful urges should be circumvented

Offline wynnyelle

  • SMF Hero
  • ******
  • Posts: 2,569
    • Warrior Cats RPG
Re: A profile error - Undefined
« Reply #22 on: January 25, 2012, 08:54:25 PM »
SimpleSEF has been causing so many issues on my site. It did cause one major crash I know that.

I've switched in your code, don't see anything going wrong yet but will keep the error log refreshing to see what turns up.  Thank you again.

Most recent error:

Code: [Select]
Apply Filter: Only show the error messages of this member ᴇʀᴀ
Apply Filter: Only show the error messages of this IP address 71.198.xx
  Reverse chronological order of list Today at 08:47:39 PM
Apply Filter: Only show the error messages of this session bedca39c40cbb9c0669b680b8ef00cee
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=profile;u=37573;area=summary
Apply Filter: Only show the errors with the same message
8: Undefined index: 12767
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Profile.php
Line: 869

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: A profile error - Undefined
« Reply #23 on: January 25, 2012, 09:08:42 PM »
Please attach Profile.php :)
No good deed goes unpunished
All helpful urges should be circumvented

Offline wynnyelle

  • SMF Hero
  • ******
  • Posts: 2,569
    • Warrior Cats RPG
Re: A profile error - Undefined
« Reply #24 on: January 25, 2012, 09:11:39 PM »
Here you are!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: A profile error - Undefined
« Reply #25 on: January 25, 2012, 09:16:46 PM »
Replace: (lines 863 onwards)
Code: [Select]
if (empty($cur_profile['is_shareable']))
{
loadMemberData(array($cur_profile['id_parent']), false, 'minimal');

$context['linktree'][] = array(
'url' => $scripturl . '?action=profile;u=' . $cur_profile['id_parent'],
'name' => $user_profile[$cur_profile['id_parent']]['real_name'],
);
}

With:
Code: [Select]
if (empty($cur_profile['is_shareable']))
{
$loaded = loadMemberData(array($cur_profile['id_parent']), false, 'minimal');
if (!empty($loaded))
{
$context['linktree'][] = array(
'url' => $scripturl . '?action=profile;u=' . $cur_profile['id_parent'],
'name' => $user_profile[$cur_profile['id_parent']]['real_name'],
);
}
}
No good deed goes unpunished
All helpful urges should be circumvented

Offline wynnyelle

  • SMF Hero
  • ******
  • Posts: 2,569
    • Warrior Cats RPG
Re: A profile error - Undefined
« Reply #26 on: January 25, 2012, 10:41:23 PM »
Thanks. I added it, and am watching the error log. What's come up most recently:

Code: [Select]
Apply Filter: Only show the error messages of this member the13woumen
Apply Filter: Only show the error messages of this IP address 98.213.xx 
  Reverse chronological order of list Today at 10:30:12 PM
Apply Filter: Only show the error messages of this session 3e58d41c498eebb642dfbc75871e8617
Apply Filter: Only show the errors of this type Type of error: General
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=profile;u=42842;area=lists;sa=buddies
Apply Filter: Only show the errors with the same message
2: Invalid argument supplied for foreach()
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Buddies.php
Line: 57

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: A profile error - Undefined
« Reply #27 on: January 26, 2012, 03:27:25 AM »
Ah, I see...

The code I posted:
Code: [Select]
// Load all the members up.
$buddies = loadMemberData($buddies, false, 'profile');

$context['buddies'] = array();
if (count($buddies) > 0)
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['buddies'][$buddy] = $memberContext[$buddy];
}

Should have been:
Code: [Select]
// Load all the members up.
$buddies = loadMemberData($buddies, false, 'profile');

$context['buddies'] = array();
if (!empty($buddies))
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['buddies'][$buddy] = $memberContext[$buddy];
}

I forgot how it handled a certain case. We may have to apply something similar to the other cases:

Code: [Select]
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['unapproved'][$buddy] = $memberContext[$buddy];
}

Becomes:
Code: [Select]
if (!empty($buddies))
{
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['unapproved'][$buddy] = $memberContext[$buddy];
}
}

And
Code: [Select]
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['pending'][$buddy] = $memberContext[$buddy];
}

Becomes:
Code: [Select]
if (!empty($buddies))
{
foreach ($buddies as $buddy) {
loadMemberContext($buddy);
$context['pending'][$buddy] = $memberContext[$buddy];
}
}
No good deed goes unpunished
All helpful urges should be circumvented

Offline wynnyelle

  • SMF Hero
  • ******
  • Posts: 2,569
    • Warrior Cats RPG
Re: A profile error - Undefined
« Reply #28 on: January 26, 2012, 01:27:37 PM »
Oh wow, let me get that file and do that, is that buddies.php?

That first change, would I do that to all 3 of those same places like I did last night? Or just the one you showed me up there?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: A profile error - Undefined
« Reply #29 on: January 26, 2012, 01:40:21 PM »
No, just do those specific changes, unlike last time it isn't the exact same code in three places, but it's slightly different each time.
No good deed goes unpunished
All helpful urges should be circumvented

Offline wynnyelle

  • SMF Hero
  • ******
  • Posts: 2,569
    • Warrior Cats RPG
Re: A profile error - Undefined
« Reply #30 on: January 26, 2012, 01:42:35 PM »
I did them, thanks :). So far nothing broke :P waiting for the error log to show anything. Error log does have this though:

Code: [Select]
Apply Filter: Only show the error messages of this member ✖ Northern.
Apply Filter: Only show the error messages of this IP address 99.252.x
  Reverse chronological order of list Today at 11:54:52 AM
Apply Filter: Only show the error messages of this session 05056fd9b51ac9b2ebb20d6e1c5a34bd
Apply Filter: Only show the errors of this type Type of error: General
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=profile;u=5775;area=managesubaccounts;sa=split
Apply Filter: Only show the errors with the same message
2: preg_split() expects parameter 2 to be string, array given
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Load.php(248) : runtime-created function
Line: 12
Apply Filter: Only show the error messages of this member ✖ Northern.
Apply Filter: Only show the error messages of this IP address 99.252.x
  Reverse chronological order of list Today at 11:54:52 AM
Apply Filter: Only show the error messages of this session 05056fd9b51ac9b2ebb20d6e1c5a34bd
Apply Filter: Only show the errors of this type Type of error: General
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=profile;u=5775;area=managesubaccounts;sa=split
Apply Filter: Only show the errors with the same message
2: strlen() expects parameter 1 to be string, array given
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Load.php(248) : runtime-created function
Line: 5
Apply Filter: Only show the error messages of this member ✖ Northern.
Apply Filter: Only show the error messages of this IP address 99.252.x
  Reverse chronological order of list Today at 11:54:32 AM
Apply Filter: Only show the error messages of this session 05056fd9b51ac9b2ebb20d6e1c5a34bd
Apply Filter: Only show the errors of this type Type of error: General
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=profile;u=5775;area=managesubaccounts;sa=split
Apply Filter: Only show the errors with the same message
2: preg_split() expects parameter 2 to be string, array given
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Load.php(248) : runtime-created function
Line: 12
Apply Filter: Only show the error messages of this member ✖ Northern.
Apply Filter: Only show the error messages of this IP address 99.252.x
  Reverse chronological order of list Today at 11:54:32 AM
Apply Filter: Only show the error messages of this session 05056fd9b51ac9b2ebb20d6e1c5a34bd
Apply Filter: Only show the errors of this type Type of error: General
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=profile;u=5775;area=managesubaccounts;sa=split
Apply Filter: Only show the errors with the same message
2: strlen() expects parameter 1 to be string, array given
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Load.php(248) : runtime-created function
Line: 5