Quote:
Originally Posted by thincom2000
I just have to figure out why HTML and IMG aren't parsed immediately following the AJAX edit pencils (until page refresh).
|
That's because of this code in ces_permissions_customfields():
PHP Code:
if (FILE_VERSION >= '3.7.0')
{
global $blockobj;
$userinfo =& $blockobj->profile->userinfo;
}
Sllight variation of the same bug I mentioned in a
previous post. When coming in through AJAX, a lot of the data structures that exist on a normal page load aren't there ... including $blockobj; I changed the above to just use $vbulletin->userinfo instead, and it works.
But I do need to test and make sure this doesn't screw up display perms when not using AJAX ...
EDIT - yup, it does need another change to work right in both cases:
PHP Code:
if (FILE_VERSION >= '3.7.0')
{
if ($_REQUEST['ajax'] == 1)
{
$userinfo =& $vbulletin->userinfo;
}
else
{
global $blockobj;
$userinfo =& $blockobj->profile->userinfo;
}
}
This seems to work. The assumption being if it's AJAX, we know we are editing the profile for the logged on user, so we can use $vbulletin->userinfo. If not AJAX, we can use the $blockobj->profile->userinfo, which will be whoever the profile belongs to.
-- hugh