Genders

Gender will not work correctly in ACP. - Genders

Gender will not work correctly in ACP.

by MDuss » Tue Mar 22, 2016 9:12 am

Hi.

I have here a Little Problem with the gendermod in the ACP.

If I want to administrate a user and I choose the Profile of the user, the gender "unknown" is marked independent what the user have choosen.

For example a user choose female and I go the ACP and choose the Profile from the user than the "unknown" is selected.
When I confirm the Profil, then the gender will be set to "unknown", so that I Need to view the Profil in the Forum to see what the User have selected for his gender before I confirm.

This is in my testforum.

In my working Forum the gender selection is alway on "male" when I go to the user Profile in the acp.
For example a User have selected female and I go to the Profile the selcetion is on male. And when I confirm than the gender is changed to male.

It seems that the request for the choosen gender have a little problem.

In the Forum itself everything is working fine.

In the UCP, in the Posts and so on is everything Ok.

The Problem is only in the ACP when I want to administarte an user an go the the Profile from the user in the acp.

I use the Mod Version 1.0.0 and the phpbb Version 3.1.8

Yours sincerely
MDuss
MDuss
Registered User
Posts: 64
Joined: Sat May 03, 2008 2:50 pm
Contact:

Re: Gender will not work correctly in ACP.

by RMcGirr83 » Tue Mar 22, 2016 10:27 am

Hi, nice catch. To fix open the listener file and find these lines

Code: Select all


    
public function user_gender_profile($event)
    {
        
// Request the user option vars and add them to the data array
        
$event['data'] = array_merge($event['data'], array(
            
'user_gender'    => $this->request->variable('gender'$this->user->data['user_gender']),
        ));  


change it to this

Code: Select all


    
public function user_gender_profile($event)
    {
        if (
DEFINED('IN_ADMIN'))
        {
            
$user_gender $event['user_row']['user_gender'];
        }
        else
        {
            
$user_gender $this->user->data['user_gender'];
        }
        
// Request the user option vars and add them to the data array
        
$event['data'] = array_merge($event['data'], array(
            
'user_gender'    => $this->request->variable('gender'$user_gender),
        )); 


I have uploaded a new version to correct this. Thanks for reporting it. :)
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Gender will not work correctly in ACP.

by MDuss » Wed Mar 23, 2016 8:16 am

Hi RMcGirr83.

I have made your code changes and now it works all correctly.
Thx.

Yours sincerely
MDuss
MDuss
Registered User
Posts: 64
Joined: Sat May 03, 2008 2:50 pm
Contact: