Store Community Support Documentation
Hi,

After upgrade to the last version of phpfox (3.7.5) this type of requests don't work anymore:

$oRequest = Phpfox::getLib('request');
$aUser = $oRequest->get('req1');

When using this on a members profile the $aUser should hold the username of the member, but after the upgrade I get nothing. The variable is blanck.

Did something change in a way we request this?

Thanks
Be the first person to like this.
Donna(data66)
#1
Moved to coding forum. Perhaps someone will post an answer as I don't know.
Be the first person to like this.
webwolf
#2
I know this isn't very helpful, but I copied your code to my profile index page and did a d($aUser); and got a good return. This is on 3.7.5(3). I also did a quick compare with request between 3.4 and 3.7 and did not find any difference visually.

My best guess is that, since request is used hundreds of times in the core code, it would really mess up a site if a simple request command didn't work. Maybe it isn't your request code but something upstream causing a problem?
Be the first person to like this.
#3
Quote:
Originally posted by: webwolf

I know this isn't very helpful, but I copied your code to my profile index page and did a d($aUser); and got a good return. This is on 3.7.5(3). I also did a quick compare with request between 3.4 and 3.7 and did not find any difference visually.

My best guess is that, since request is used hundreds of times in the core code, it would really mess up a site if a simple request command didn't work. Maybe it isn't your request code but something upstream causing a problem?


Thanks webwolf... I will check this again with more detail, but the only thing I have donne was upgrading the site to the last version.
Be the first person to like this.
#4
I have just create this bug report with steps for the bug. Can you check if you can reproduce it?

http://www.phpfox.com/tracker/view/15189/

Thanks
Be the first person to like this.
webwolf
#5
I can reproduce this bug on my test server.
Be the first person to like this.
#6
Quote:
Originally posted by: webwolf

I can reproduce this bug on my test server.


Can you add this confirmation on the bug track page?

Thanks
Be the first person to like this.
Donna(data66)
#7
I already asked a core developer to look at it. I can reproduce it but am not sure about that block position in that particular part of the profile.
Be the first person to like this.
webwolf
#8
Sorry, I should have included that I did add the confirmation on the tracker.

As a workaround, have you tried:

PHP:
$aTemp $this->getParam('aUser');
echo 
$aTemp['user_name']; 


I have used this on profile blocks and it seems to do the job.
Be the first person to like this.
#9
Quote:
Originally posted by: webwolf

Sorry, I should have included that I did add the confirmation on the tracker.

As a workaround, have you tried:

PHP:
$aTemp $this->getParam('aUser');
echo 
$aTemp['user_name']; 


I have used this on profile blocks and it seems to do the job.


Wolf,

The code you send will show the user_name of the member that is loged, and not the user_name of the profile owner, am I wrong?

Regards
Be the first person to like this.
webwolf
#10
It will give you a huge amount of data for the profile that you are viewing. Here is a sample I (as user_id 1) got when viewing user_id 6:
PHP:
Array
(
    [
is_viewed] => 6
    
[cover_photo_exists] => 
    [
user_id] => 6
    
[profile_page_id] => 
    
[server_id] => 
    
[user_group_id] => 2
    
[status_id] => 
    
[view_id] => 
    
[user_name] => profile-6
    
[full_name] => Registered User
    
[password] => (removed)
    [
password_salt] => (;E
    
[email] => yyy@aaa.com
    
[gender] => 1
    
[birthday] => 33
    
[birthday_search] => 329875200
    
[country_iso] => 
    [
language_id] => 
    [
style_id] => 
    
[time_zone] => 
    [
dst_check] => 
    
[joined] => 1380378766
    
[last_login] => 1389413773
    
[last_activity] => 1389414317
    
[user_image] => 
    [
hide_tip] => 
    
[status] => 
    [
footer_bar] => 
    
[invite_user_id] => 
    
[im_beep] => 
    
[im_hide] => 
    
[is_invisible] => 
    
[total_spam] => 
    
[last_ip_address] => 192.168.1.101
    
[feed_sort] => 
    
[space_attachment] => 20376
    
[space_photo] => 209309
    
[space_poll] => 
    
[space_quiz] => 
    
[space_marketplace] => 
    
[space_event] => 
    
[space_group] => 
    
[space_music] => 
    
[space_music_image] => 
    
[space_video] => 
    
[space_pages] => 
    
[space_total] => 229685
    
[first_name] => 
    [
last_name] => 
    [
signature] => 
    [
signature_clean] => 
    [
designer_style_id] => 
    [
total_comment] => 
    
[total_view] => 2
    
[total_friend] => 1
    
[total_post] => 1
    
[total_profile_song] => 
    
[total_score] => 0.00
    
[total_rating] => 
    
[total_user_change] => 
    
[total_full_name_change] => 
    
[country_child_id] => 
    
[city_location] => 
    [
postal_code] => 
    [
subscribe_id] => 
    
[dob_setting] => 
    
[birthday_range] => 0615
    
[rss_count] => 
    
[css_hash] => 
    [
newsletter_state] => 
    
[in_admincp] => 
    
[default_currency] => 
    [
total_blog] => 
    
[total_video] => 
    
[total_poll] => 
    
[total_quiz] => 
    
[total_event] => 
    
[total_song] => 
    
[total_listing] => 
    
[total_photo] => 
    
[total_pages] => 
    
[brute_force_locked_at] => 
    [
relation_data_id] => 
    
[relation_with] => 
    
[cover_photo] => 
    
[cover_photo_top] => 
    [
use_timeline] => 
    
[landing_page] => wall
    
[location_latlng] => 
    [
activity_blog] => 
    
[activity_attachment] => 2
    
[activity_comment] => 9
    
[activity_photo] => 
    
[activity_bulletin] => 
    
[activity_poll] => 
    
[activity_invite] => 
    
[activity_forum] => 1
    
[activity_video] => 
    
[activity_total] => 13
    
[activity_points] => 13
    
[activity_quiz] => 
    
[activity_music_song] => 
    
[activity_marketplace] => 
    
[activity_event] => 
    
[activity_pages] => 
    
[activity_points_gifted] => 
    
[is_online] => 
    [
designer_style_folder] => 
    [
designer_theme_folder] => 
    [
total_column] => 
    [
l_width] => 
    [
c_width] => 
    [
r_width] => 
    [
theme_parent_id] => 
    [
prefix] => 
    [
suffix] => 
    [
icon_ext] => 
    [
title] => Registered User
    
[is_featured] => 
    [
user_server_id] => 
    
[is_friend] => 1
    
[is_friend_of_friend] => 
    [
is_friend_request] => 
    [
gender_name] => Male
    
[birthday_time_stamp] => 06151980
    
[location] => 
    [
birthdate_display] => Array
        (
            [
Birth Date] => June 151980
        
)

    [
is_user_birthday] => 
Last update on February 26, 4:28 pm by webwolf.
Be the first person to like this.
#11
Wolf,

your solution don't work on a PHP block.

Regards
Last update on February 26, 5:01 pm by cespiritual.
Be the first person to like this.
webwolf
#12
I hadn't tried it on a php block (admincp). I would have expected it to work there too, but it didn't.

The data is available, however. I was able to get to it by using the code below:

PHP:
<?php
$aTemp 
$this->_aVars['aUser'];
echo 
"User name is: " $aTemp['user_name'];
?>
Be the first person to like this.
#13
Quote:
Originally posted by: webwolf

I hadn't tried it on a php block (admincp). I would have expected it to work there too, but it didn't.

The data is available, however. I was able to get to it by using the code below:

PHP:
<?php
$aTemp 
$this->_aVars['aUser'];
echo 
"User name is: " $aTemp['user_name'];
?>





Works fine, thanks!
Last update on February 26, 6:56 pm by cespiritual.
Be the first person to like this.