× Here you can get community support related to ReDJ.

I´m not detecting errors

  • jrodgar
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 5 months ago #1806 by jrodgar
I´m not detecting errors was created by jrodgar
Ok, probably just another dumb question >_>


Plugin activated, I try to access to localhost/joomla/dontexist (my root is localhost/joomla)

I don´t see an entry on the errors list. Must I?

Please Log in or Create an account to join the conversation.

  • jrodgar
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 5 months ago #1811 by jrodgar
Replied by jrodgar on topic I´m not detecting errors
Nevermind, I didn´t activate the tracking on the plugin >_<

Please Log in or Create an account to join the conversation.

  • jrodgar
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 5 months ago #1815 by jrodgar
Replied by jrodgar on topic I´m not detecting errors
Actually, it wasn´t a dumb question :O

After activating the tracking I didn´t track any errors. I detected two problems

The first one, that I don´t know why but the 1034:setErrorHandling wasn´t working. I added the set_exception_handler as in plugins/system/redirect/redirect.php:36

The second one, that I guess the api seems it changed and the typical function "$error->get('error')" and "$error->get('message')" aren´t working anymore. They have to be "$error->getError()" and "$error->getMessage()". I see that you have more function with the old way, but I didn´t receive any error so I didn´t change them, but more testing would be necessary.

I add the diff as file, cause if I enter it here it says "Sql injection detected"

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

  • jrodgar
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 5 months ago #1816 by jrodgar
Replied by jrodgar on topic I´m not detecting errors
Ok, I have made some changes more that I think improve the code.

On line 455 aprox.

Change
header("HTTP/1.1 301 Moved Permanently");
header('Location: ' . $tourl);
with
		$app = JFactory::getApplication();				
		$tourl = str_replace('&amp;','&',$tourl);
		$app->redirect($tourl, $error->getMessage(), $msgType='message');

I think is better use the joomla way, and adding the informative message


On 535 (after the setErrorHandling)
restore_exception_handler();
I´m not sure about this one, but I think is the correct way to restore the handler

On line 543 and 551, where the get('level') are, I put this
      $exception = new JException($error->getMessage(), 
      $error->getCode()
//, $error->get('level') 
//, $error->get('info')
//, $error->get('backtrace')
									);
      // See what to do with this kind of error
      //$handler = JError::getErrorHandling($exception->get('level'));
	  $handler = JError::getErrorHandling(E_ERROR);
I haven´t found the equivalent for get('level') and so


What do you think? If you think this ones are worth it, they could be integrate, in case is updated later.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #1822 by admin
Replied by admin on topic I´m not detecting errors
Sorry for delay,
I wanted to tell you in time that in the new version (1.7.3) I've completely rewritten the error handling to support both J2 and J3. But I'm happy to have users so enterprising ... :)

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • jrodgar
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 5 months ago #1823 by jrodgar
Replied by jrodgar on topic I´m not detecting errors
Feel free to integrate whatever you can take advantage of ;)

When for is planned?

Please Log in or Create an account to join the conversation.

Time to create page: 0.140 seconds