6.0.0-beta1
9/24/25

[#938] Display error upon adding a contact
Summary Display error upon adding a contact
Queue Turba
Queue Version 2.0-RC2
Type Bug
State Resolved
Priority 2. Medium
Owners
Requester mik (at) galaxie (dot) net
Created 12/05/2004 (7598 days ago)
Due
Updated 12/05/2004 (7598 days ago)
Assigned
Resolved 12/05/2004 (7598 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/05/2004 02:01:49 AM Chuck Hagenbuch Comment #3
State ⇒ Resolved
Reply to this comment
Should be fixed now, slightly differently.
12/05/2004 12:13:08 AM mik (at) galaxie (dot) net Comment #2 Reply to this comment
unified..

--- ./ObjectView.php    2004-11-17 21:36:41.000000000 +0100

+++ ./fixed/ObjectView.php    2004-12-05 00:28:19.000000000 +0100

@@ -108,7 +108,7 @@

                       * However, only do this on the display.php page. */

                      if (($attribute['type'] == 'email') &&

                          (basename($_SERVER['PHP_SELF']) == 'display.php')) {

-                        $params = array(false, false, true, 
(!empty($form->_vars['name'])) ? $form->_vars['name'] : null);

+                        $params = array(false, false, true, 
(!empty($form->_vars->_vars['name'])) ? $form->_vars->_vars['name'] : 
null);

                      }



                      $v = &$form->addVariable($attribute['label'], 
'object[' . $field . ']', $attribute['type'], $attribute['required'], 
$readonly, $desc, $params);


12/05/2004 12:09:07 AM mik (at) galaxie (dot) net Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Display error upon adding a contact
Queue ⇒ Turba
Reply to this comment
Submitting the form in add.php redirects to display.php, where a 
display error shows "Fatal, cannot use Variable object as array  in 
file ObjectView.php at line 111".

the idea is:

$form->_vars                 is the Variables object

$form->_vars->_vars    is the actual array



The following patch fixes the problem:



*** ./ObjectView.php    Wed Nov 17 21:36:41 2004

--- ./fixed/ObjectView.php    Sun Dec  5 00:28:19 2004

***************

*** 109,113 ****

                       if (($attribute['type'] == 'email') &&

                           (basename($_SERVER['PHP_SELF']) == 'display.php')) {

!                         $params = array(false, false, true, 
(!empty($form->_vars['name'])) ? $form->_vars['name'] : null);

                       }



--- 109,113 ----

                       if (($attribute['type'] == 'email') &&

                           (basename($_SERVER['PHP_SELF']) == 'display.php')) {

!                         $params = array(false, false, true, 
(!empty($form->_vars->_vars['name'])) ? $form->_vars->_vars['name'] : 
null);

                       }




Saved Queries