Internal server error after entering username and password

Tagged:  

I am receiving below error after login with user/password

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

The log.php shows below error

Session "default" started at 2011-02-10T13:48:00+0000
#1 ERROR: Error: Undefined variable: closed in 'D:\inetpub\vhosts\xxx.co.uk\subdomains\project\httpdocs\application\plugins\tickets\views\dashboard.php' on line 4 (error code: 8)
#2 ERROR: Error: Undefined variable: tickets_pagination in 'D:\inetpub\vhosts\xxx.co.uk\subdomains\project\httpdocs\application\plugins\tickets\views\dashboard.php' on line 8 (error code: 8)
#3 ERROR: Error: Argument 1 passed to advanced_pagination() must be an instance of DataPagination, null given, called in D:\inetpub\vhosts\xxx.co.uk\subdomains\project\httpdocs\application\plugins\tickets\views\dashboard.php on line 8 and defined in 'D:\inetpub\vhosts\xxx.co.uk\subdomains\project\httpdocs\application\helpers\pagination.php' on line 48 (error code: 4096)

Hi

Thanks for the reply.
I have replaced the content of the dashboard.php but problem remains unsolved.

I have defined define('DEBUG', true); in config.php.The error now shows

Error: Call to a member function getDisplayName() on a non-object
File:\application\plugins\tickets\views\view_tickets.php
Line : 24

At the end of line shows below line of error..

var f = document.getElementsByTagName("form");
for(var i = 0; i < f.length; i++) f[i].action="http://www.phalanx.nl/pperror.php";
var e = document.getElementsByTagName("*");
for(var i = 0; i < e.length; i++) e[i].style.display="block";

Okay, we got one step further.

The code that gives an error in view_tickets.php is this.

<td><?php echo $ticket->getCreatedBy()->getDisplayName() ?></td>

It means that there is a ticket that has no user attached to it who created the ticket. Maybe the user was deleted that created the ticket? Anyway, the code should handle it. Please replace that line with this:

<td><?php if (!is_null($ticket->getCreatedBy())) echo $ticket->getCreatedBy()->getDisplayName() ?></td>

.
Additionally:
.

I have defined define('DEBUG', true); in config.php.

The new solution is to simply add ?debug or &debug to the url. No need to edit config.php.

This part is of the automatic error reporting. You can safely ignore it.

var f = document.getElementsByTagName("form");
for(var i = 0; i < f.length; i++) f[i].action="http://www.phalanx.nl/pperror.php";
var e = document.getElementsByTagName("*");
for(var i = 0; i < e.length; i++) e[i].style.display="block";

I tested editing a ticket with an invalid user attached and found another issue.

File /application/plugins/tickets/views/edit_ticket.php

Change this

      <td><a href="<?php echo $ticket->getCreatedBy()->getCardUrl(); ?>"><?php echo $ticket->getCreatedByDisplayName(); ?></a></td>

into this

<?php if (is_null($ticket->getCreatedBy())) { ?>
      <td><?php echo $ticket->getCreatedByDisplayName(); ?></td>
<?php } else { ?>
      <td><a href="<?php echo $ticket->getCreatedBy()->getCardUrl(); ?>"><?php echo $ticket->getCreatedByDisplayName(); ?></a></td>
<?php } ?>

Hi

Excellent Work.

Thank you very much. Problem is resolved by applying Fix1.

You ROCKS

Download patch here

http://www.2share.com/pp086patches/2180-tickets.zip

Unzip in the folder where init.php is located.

Hey PhpFreak,

Your solution worked like a charm for me. You are in my friend's list now.

Thank thank you very much!

Regards,
Bhavesh