We’re rewarding the question askers & reputations are being recalculated! Read more.
17

As @DmitryRekun said, a good discussion is here. The key piece to consider in all of this is what type of error do you have? There are two types of errors: Recoverable Unrecoverable. The difference I tend to sum up as follows: Can I still show the page that was requested, even though this error occurred? Yes? - Recoverable No? - Unrecoverable Now that ...


13

JError has been deprecated in J3.x, in favour of PHP exceptions, as it intermixed 2 different programming concepts: logging and error handling (the logging side has now been implemented as JLog). For your exact case, you can wrap your code in a try / catch block to get the error, as shown in this SO answer: try { ... $db->setQuery($query); $...


12

Here is how I'm managing an errors. View or Controller try { $this->item = $this->get('Item'); } catch (Exception $e) { if ($e->getCode() == 404) { // Not found throw new Exception($e->getMessage(), 404); } // Generic errors JFactory::getApplication()->enqueueMessage(JText::_('...


6

I have test another solution thanks to the user @farahmand and it's worked very well and I decided to provide a step by step guide for the solution Solution One: First find the exact absolute path to your tmp folder by using this trick: Create a PHP file in your website root,for example path.php Place this snippet of code in the file and hit the save ...


6

Maybe you can use a try catch command: try { //Your code to run the SQL here } catch (Exception $e) { $this->setError('The error message you want'); return false; }


6

Pretty much the same as @ValentinDespa 's answer but i'm just gonna merge the two things together into something that will work in 2.5 and 3.x. This rather than displaying a full page error message just returns false and then inserts an error message into the top of the page. Hope that's what you're after $db = JFactory::getDbo(); $query = $db->getQuery(...


6

Try this small Plugin from Viktor Vogel. This plugin gives the possibility to control the reporting per user group. Big advantage of this is, that you don't need to hack core files. http://joomla-extensions.kubik-rubik.de/eer-easy-error-reporting


5

You'll want to create a custom PHP error handler and have that send you an email. You can use FILE and FUNCTION and LINE constants to load where the error happened into the email that you alert yourself with. Take a look at how to do all of that here: https://stackoverflow.com/questions/277224/how-do-i-catch-a-php-fatal-error


4

Watch out for exposing too much info! Please note that by throwing SQL errors into the wild, you may expose your database structure or other sensitive information. I would throw SQL errors only in backend (to let's say trusted users) and in frontend just a generic error and I would log the exact error in a error log. Doing a query in 3.x catching and ...


4

Most code blocks like this can simply be replaced with enqueueMessage since they are not actually acting on the error and simply using JError to print them out. // Check for errors. if (count($errors = $this->get('Errors'))) { foreach($errors as $error) { JFactory::getApplication()->enqueueMessage($error, 'error'); } }


4

Just some additional information on this error, copied right out of the default htaccess.txt file that comes with Joomla: # The line just below this section: 'Options +FollowSymLinks' may cause problems # with some server configurations. It is required for use of mod_rewrite, but may already # be set by your server administrator in a way that dissallows ...


4

This is the way I use to add a log entry to a file. JLog::add has changed too much between Joomla versions. $config = array( 'text_file' => 'logging.log' ); // Joomla 3 jimport('joomla.log.logger.formattedtext'); $logger = new JLogLoggerFormattedtext($config); // Joomla 2.5 // jimport('joomla.log.loggers.formattedtext'); // $logger = new ...


4

I've found out that the easiest/faster method to resolve this was to use a script reading apache's logs and send a mail every day with a summary. FYI : Server's setup has a daily log rotation, run the script through crontab, just before rotation time. (Plus : I'm french, so there are french words in the mail being sent). Here's the script : (I know it ...


4

For Joomla on php7+ non-fatal errors no longer contain the file and line in the error. The trick is to handle the output of these errors in your template's error.php file. Add the file if it doesn't exist. With a number of templates (including beez) they will show you the stacktrace (and thus also the location of the call the threw the error) if you have ...


3

You can add an .htaccess file into administrator directory with: php_flag display_errors on php_value error_reporting <integer> Ref: https://stackoverflow.com/questions/6127980/enabling-error-display-in-php-via-htaccess-only


3

My most convenient trick I use in this case, is by creating a temporary hack on the framework.php file, inside the /administrator/includes/ directory. The error reporting for the admin is handled in framework.php ~line 52. // Set the error_reporting switch ($config->error_reporting) { case 'default': case '-1': break; case 'none'...


3

You should use PHP Exceptions instead. I do find it odd that Joomla throws deprecated messages when using JError yet isn't still used in the 3.3.6 core. Anyway, the below would be an example of Exceptions for a database query $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($db->quoteName(array('username'))) ->from($...


3

Since it doesn't appear to be possible to prevent this behaviour, I implemented the following solution. Add a duplicate check to a JTable check method override: // Check for duplicate entry $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('COUNT(*)'); $query->from($this->get('_tbl')); $query->where($db->quoteName('...


3

If your URLs are working fine when you don't use SEF URLs and the 404 error page appears only when SEF URLs are turned ON, then it is most likely that the .htaccess file on your Joomla website is not properly configured. Have you tried renaming the htaccess.txt (which comes by default with Joomla) to .htaccess ? If not, you should try renaming htaccess.txt ...


3

Do you have caching enabled? Disable while developing. Have you changed the URL Rewrite option? Have you renamed the .htaccess.txt file? Try rebuilding menus option from menu manager. Also make sure your alias is exactly as it should be (no extra spaces). Sorry if these steps are all overly obvious.


3

I've got it!!! You have to include: JHtml::_('behavior.framework'); and the javascript is something like this: jQuery("#user_name").attr('title','Kérem előbb válassza ki a hatályba lépés dátumát!'); jQuery("#user_name").tooltip('show'); Make sure that these two line are in the done method of your jquery ajax call. Then you have to destroy it: jQuery("#...


3

You should use a session to save the form data. In the CMS there is a special User State for this. Just before you return false you should save the current data into the user state: // Save the form data in the session JFactory::getApplication()->setUserState($this->option . '.edit.authorization.data', $postData); $this->option here is the name of ...


3

If you have any problem with the purchased extensions from Offlajn, you can create a support ticket on our site: http://offlajn.com/contact-us.html Our kind support team is always ready to help you. In your case you have uninstalled all of the parts of the Improved AJAX Login & Register, except the System - Improved AJAX Login and Register system ...


3

There is a current extension in the JED that says it allows you to output to specific levels. https://extensions.joomla.org/extensions/extension/miscellaneous/development/easy-error-reporting/ Free to download so even if you don't use it you could have a look under the covers as to how they have achieved it.


3

Found the answer. When I renamed the database I also had to re-assign the database user to this database.


2

Chiming in with another possible solution. I just ran into the same issue that was confounding me. I tried turning SEF URLs off, swapped the .htaccess / .hthacces.txt files, etc. All the recs you will find while Google-ing a solution for this issue. Unique problem: All the 404 articles were in the same sub-category, 3 layers down from root menu. Diagnosed ...


2

I was having the same issue when I redesigned a site for a client. I built the site on my server and transferred it to theirs. I couldn't figure out why this one alias (services) wouldn't work. If I changed it to "our services" or anything else, it worked fine, but I really wanted to keep the same structure as I originally set up. In this case, it turned out ...


2

You can customize the 404 error (example show a custom page or send somewhere other than the homepage) by adding a PHP file to your template, name it error.php and place it in the root of the template (next to the index.php of the template). Inside that file you can indicate what to do, for example send to somewhere in your site (update /SOMEWHEREINYOURSITE ...


2

This isn't an error but expected behavior. If you navigate to Components > Redirect in the Joomla Administrator's interface, you will see a list of all URLs requests resulting in a 404. Joomla automatically records them in this component and the re-routes the request to the home page. The reason why is two fold, first is to prevent a negative user ...


2

Another solution suggested at the Joomla forum is to enable the FTP layer. The FTP layer can be enabled from System -> Global Configuration -> Server tab -> FTP Settings. Add FTP details (host, username and password) for a user with access to your server. I'm not able to test it myself because I can't reproduce the error, but apparently by enabling FTP, ...


Only top voted, non community-wiki answers of a minimum length are eligible