[dev] moment error

Amith Varghese amith at xalan.com
Tue Mar 4 11:12:02 PST 2003


> For anyone who wants to track this further down: This happens in meeting.php
> in the switch 'default' case, because $view is 'day'. After the factory
> call, $view is a Moment_View_day object, casted to the string 'Object' in
> templates/meeting/header.inc.

Thanks for the help, i've attached a patch to fix the problem.  Basically there
was a problem with the $view variable getting clobbered by the factory method.

Another question I have (which i know has been asked before) is what methods do
people use for debugging?  I tried dbg and ddd but it seemed like it only works
for simple PHP scripts.  Once you try to deal with form/web input it really
doesn't work.  I'm using linux on my desktop (so no windows solutions please)
and i would prefer something free.  If there are no free alternatives what else
is out there?  Right now i'm using Horde::logMessage, var_dump, and print_r but
its pretty slow.

Thanks
Amith
-------------- next part --------------
Index: meeting.php
===================================================================
RCS file: /repository/moment/meeting.php,v
retrieving revision 1.18
diff -u -r1.18 meeting.php
--- meeting.php	22 Feb 2003 20:04:21 -0000	1.18
+++ meeting.php	4 Mar 2003 16:03:53 -0000
@@ -310,20 +310,20 @@
         break;
 
     default:
-        $view = &Moment_View::singleton($view);
+        $attendee_view = &Moment_View::singleton($view);
 
         foreach ($meeting['attendees'] as $attendee) {
             if ($attendee['attendance'] == 'required') {
                 $vfb = Moment::getFreeBusy($attendee['email']);
                 if (!is_a('PEAR_error', $vfb)) {
-                    $view->addRequiredMember($vfb);
+                    $attendee_view->addRequiredMember($vfb);
                 } else {
                     $notification->push(sprintf(_("Error retrieving free/busy information for %s: %s"), $attendee['email'], $vfb->getMessage()));
                 }
             } else {
                 $vfb = Moment::getFreeBusy($attendee['email']);
                 if (!is_a('PEAR_error', $vfb)) {
-                    $view->addOptionalMember($vfb);
+                    $attendee_view->addOptionalMember($vfb);
                 } else {
                     $notification->push(sprintf(_("Error retrieving free/busy information for %s: %s"), $attendee['email'], $vfb->getMessage()));
                 }
@@ -333,7 +333,7 @@
         $notification->notify();
         require MOMENT_TEMPLATES . '/meeting/header_long.inc';
         require MOMENT_TEMPLATES . '/meeting/time.inc';
-        $view_html = $view->render(Horde::getFormData('date', time()));
+        $view_html = $attendee_view->render(Horde::getFormData('date', time()));
         require MOMENT_TEMPLATES . '/meeting/meeting.inc';
         require MOMENT_TEMPLATES . '/meeting/footer.inc';
 }


More information about the dev mailing list