News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

A profile error - Undefined

Started by wynnyelle, January 23, 2012, 08:15:52 PM

Previous topic - Next topic

wynnyelle

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.

Arantor

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:
// 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.

wynnyelle

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:


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

Arantor



Arantor

Replace: (lines 863 onwards)
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:
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'],
);
}
}

wynnyelle

Thanks. I added it, and am watching the error log. What's come up most recently:


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

Arantor

Ah, I see...

The code I posted:
// 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:
// 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:

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


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


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


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

wynnyelle

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?

Arantor

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.

wynnyelle

I did them, thanks :). So far nothing broke :P waiting for the error log to show anything. Error log does have this though:


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

Advertisement: