Feng Forum

Support => Feng Office 3 => : infinity March 05, 2015, 12:44:14 PM

: Bug version 3.1 and 3.1.1 Can`t change user data
: infinity March 05, 2015, 12:44:14 PM
1. My username has super administrator rights, i`m trying to change my first name an last name. During i`m trying to change first and last name appears error 500 Internal Server Error
2. Can`t change user role to super administrator

Anybody know how to fix it?
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: marsian March 05, 2015, 02:51:25 PM
If you enable the debug mode it should show you some more Information on what exactly crashes, see http://www.fengoffice.com/web/wiki/doku.php/debugging
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: infinity March 05, 2015, 05:12:14 PM
Appears empty page, inside log.php:

Session "default" started at 2015-03-05T20:06:14+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
Time since start: 0.026876926422119 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:14+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
Time since start: 0.027323007583618 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:14+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
Time since start: 0.065119981765747 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:15+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
Time since start: 0.036632061004639 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:19+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
#2 ERROR: Error: Undefined variable: image in '/var/www/html/application/views/contact/card.php' on line 22 (error code: 8)
Time since start: 0.056920051574707 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:23+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
#2 ERROR: Error: Invalid argument supplied for foreach() in '/var/www/html/application/helpers/permissions.php' on line 615 (error code: 2)
Time since start: 0.09558892250061 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:23+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
Time since start: 0.05220103263855 seconds
-------------------------------------------------------------------------------

Session "default" started at 2015-03-05T20:06:23+0000
#1 ERROR: Error: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in '/var/www/html/environment/librar$
Time since start: 0.02698802947998 seconds
-------------------------------------------------------------------------------

And finaly, i can`t modify any contact data of Super Administrator  :-X
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: JourdanD March 07, 2015, 07:18:33 PM
I have the exact same problem on 3.1.1 and 3.1.2.  I can create new users but can't edit existing ones.  If I try to edit something, once I hit save account it pops up a 500 internal server error as described in the rest of this thread.
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: jacob March 09, 2015, 02:26:12 AM
Same problems here on a fresh install

With debug mode on I get this sometimes when trying to edit users:
Fatal error: Call to a member function getId() on a non-object in /var/www/plugins/core_dimensions/hooks/core_dimensions_hooks.php on line 373
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: jacob March 09, 2015, 08:42:43 AM
I have created a workaround for this bug that works in version 3.1.2
I do not know of any possible side-effects it may have but at least I can edit users.

The problem appears on line 373 of /plugins/core_dimensions/hooks/core_dimensions_hooks.php

Feng is apparently trying to get the parent member of a company and is coming up empty handled, throwing an unhanded error.


In the core_dimensions_hooks.php file

Replace this if block:
if ($object->getCompanyId() > 0) {
                                $pmember = Members::findOne(array('conditions' => '`object_id` = '.$object->getCompanyId(). ' AND `object_type_id` = '.$company_ot->getId(). ' AND `dimension_id` = '.$person_dim->getId()));
                                $member->setParentMemberId($pmember->getId());
                                $member->setDepth($pmember->getDepth() + 1);
                        }else{
                                //Is first level
                                $member->setDepth(1);
                                $member->setParentMemberId(0);
                        }

With this if block:
if ($object->getCompanyId() > 0) {
                                $pmember = Members::findOne(array('conditions' => '`object_id` = '.$object->getCompanyId(). ' AND `object_type_id` = '.$company_ot->getId(). ' AND `dimension_id` = '.$person_dim->getId()));

                                if($pmember) //Do not use pmember if null for any reason / hack by jacob on the fengoffice forum
                                {
                                $member->setParentMemberId($pmember->getId());
                                $member->setDepth($pmember->getDepth() + 1);
                                } else {
                                $member->setDepth(1);
                                $member->setParentMemberId(0);
                                }
                        }else{
                                //Is first level
                                $member->setDepth(1);
                                $member->setParentMemberId(0);
                        }
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: infinity March 10, 2015, 02:10:12 PM
Hi there, i think you have an error in this string, can you check again? A have empty page as a result

$pmember = Members::findOne(array('conditions' => '`object_id` = '.$object->getCompanyId().' AND `object_type_id` = '.$company_ot->getId(). ' AN$

: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: jacob March 11, 2015, 03:56:11 AM
Hi there, i think you have an error in this string, can you check again? A have empty page as a result

$pmember = Members::findOne(array('conditions' => '`object_id` = '.$object->getCompanyId().' AND `object_type_id` = '.$company_ot->getId(). ' AN$



OOPS You are absolutely correct it should be:
  $pmember = Members::findOne(array('conditions' => '`object_id` = '.$object->getCompanyId(). ' AND `object_type_id` = '.$company_ot->getId(). ' AND `dimension_id` = '.$person_dim->getId()));


Sorry about that, I just copied it out of my SSH window and didnt notice it cut off a line
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: infinity March 11, 2015, 05:44:27 AM
You are the best!!! Works great!!! Thank u!   8)
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: gonggo March 11, 2015, 10:20:42 AM
found the bug in v 3.1.2
works like a charm. thank you!!
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: franponce87 March 20, 2015, 10:50:24 AM
Hi everyone!

I am not entirely sure whether this issue has already been solved, but I have already shared this thread with our Dev Team.

Thank you all for your input!

Best regards,
Francisco
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: Dan April 08, 2015, 11:21:53 AM
Thanks a lot Jacob! Worked great for me.
: Re: Bug version 3.1 and 3.1.1 Can`t change user data
: franponce87 May 19, 2015, 11:40:08 AM
This issue was happening depending on the server settings, but if anyone is still experiencing, please upgrade to the latest version available of Feng Office as some changes were applied long ago.

Best,
Francisco