How to fix vQmod errors and conflicts
Sorry for my English! English is not my native language. One of the reasons to create this blog is to improve my English writing. So I will be highly obliged if you will help me with this. If you find a grammar error on this page, please select it with your mouse and press Ctrl+Enter.
In my previous articles I wrote "what is vQmod", "how to install vQmod" and "how to create vQmod files".
In this article you will learn how to fix vQmod errors and conflicts.
As I noticed earlier vQmod is a very bad development tools because it is the reason of many errors and conflicts in OpenCart. If you have 2 vQmod files what modify the same piece of code in the same file, then with very high probability you will get a conflict and at least one of these vQmod files will not work and possibly the whole OpenCart will show you a white screen of death.
What can you do in this situation?
1. Open the directory "vqmod/logs" there should be a log file with information about the error. This file will be named something like "5_Fri.log".
In this file will be text like this (without comments):
// Error date and time
---------- Date: 2014-10-17 17:34:25 ~ IP : ::1 ----------
// The page on which this error occurs
REQUEST URI : /opencart/1564/index.php?route=product/search&search=apples
MOD DETAILS:
// vQmod file in which the error occurred
modFile : /var/www/html/opencart/1564/vqmod/xml/search_mr.xml
// vQmod file id (name of the modification)
id : Better Search
// Modification version
version : 1.0.0
// vQmod version
vqmver : 1.0.9
// The author of the modification
author : sv2109@gmail.com
// The file in which the error occurred
File Name : catalog/controller/product/search.php(0)
// Information about the error. Most often it is "SEARCH NOT FOUND"
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): $product_total = $this->model_catalog_product->getTotalProducts($data);
----------------------------------------------------------------------
It means that when a user opened the page "/opencart/1564/index.php?route=product/search&search=apples"
the vQmod file "vqmod/xml/search_mr.xml"
couldn't find the text "$product_total = $this->model_catalog_product->getTotalProducts($data);"
in the file "catalog/controller/product/search.php"
As I noticed before the replacement code should be exactly the same as in the original file, no extra spaces, tabs etc.
Now to find the cause of the error you need to open the file "catalog/controller/product/search.php" and find the code similar to "$product_total = $this->model_catalog_product->getTotalProducts($data);" It can be slightly different. For example, can contain extra spaces or tabs. You should find this code and replace the problem code in the vQmod file. After this you should clear the vQmod cache (delete the file "catalog/controller/product/search.php" in the "vqmod/vqcache" directory) and run your site. If you have done everything well the error should disappear.
2. If the file "catalog/controller/product/search.php" is all right but vQmod still not working. Then you need to open the cached version of the file "catalog/controller/product/search.php" in the "vqmod/vqcache" directory and look for problems in this file. Maybe it was modified by another vQmod file. In this case there is no ready answer. You need to learn modified code and find the way to fix it.
3. If the directory "vqmod/logs" is empty. Try to change file access permission for this directory to 777.
4. Still not working? Make sure that vQmod is installed on your site. You can open the vQmod installation url again (http://your_site/vqmod/install).
If you still haven't fixed your problem - write a comment about it.
Add new comment