How do I activate the debugger in CS-Cart? - cs-cart

How do I activate the debugger in CS Cart?
I've done this:
http://docs.cs-cart.com/4.2.x/tools/debugger.html#activate-debug-mode
i.e added the debug term while logged into the Administrator panel.
Update:
actually I'm using v 4.1.4 but the documentation is still the same.
No joy.
What else do I have to do?

If you set DEBUG_MODE to true in your config.php, and clear the cache, it will enable the debug bar.
Did you clear your cache? (path-to-your-site.com/your-admin.php?cc&ctpl)

Go to config.php file in your cs-cart root folder and uncomment below line
// Uncomment to enable the developer tools: debugger, PHP and SQL loggers, etc.
// define('DEBUG_MODE', true);
// Uncomment to enable error reporting.
// define('DEVELOPMENT', true);

Related

How to handle the browser cache issue in Oracle JET web application

I am facing the cache issue whenever I do a new deployment, changes are not reflecting automatically. Always I have to go to the browser setting and clear the cache.
Is there a way to handle this issue automatically whenever I do the new deployment.
requirejs.config({
// Path mappings for the logical module names
paths: {
'knockout': 'libs/knockout/knockout-3.4.0',
'jquery': 'libs/jquery/jquery-3.1.1.min',
'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.12.0',
'promise': 'libs/es6-promise/es6-promise.min',
'ojs': 'libs/oj/v3.2.0/min',
'ojL10n': 'libs/oj/v3.2.0/ojL10n',
'ojtranslations': 'libs/oj/v3.2.0/resources',
'signals': 'libs/js-signals/signals.min',
'text': 'libs/require/text',
'hammerjs': 'libs/hammer/hammer-2.0.8.min',
'moment': 'libs/moment/moment.min',
'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.0.min',
'customElements': 'libs/webcomponents/CustomElements'
},
waitSeconds: 0,
// urlArgs will be appended at end of .js files
urlArgs: "v=1.33",
// Shim configurations for modules that do not expose AMD
shim: {
'jquery': {
exports: ['jQuery', '$']
}
},
config: {
ojL10n: {
merge: {
//'ojtranslations/nls/ojtranslations': 'resources/nls/menu'
}
}
}
});
You can update version (by changing urlArgs parameter in configuration) every time you deploy new code, thus every time new JavaScript file will be downloaded.
This can always be a problem during development. There are a couple of solutions.
1) Build into your app URL, a version string. Every time you publish a new version, change that number and the browser will pull new files
2) Set the cache control values on your server so that it doesn't cache anything from your app directory
3) Just do what you're doing with clearing browser cache. There are utilities that add a button on the browser bar to make it easier to get at.
I personally use the node http-server library to run my dev work and I use it's cache control arguments to make sure nothing is being cached.
http-server -c-1 -o
The above turns off caching and launches the browser from the current location (loading index.html if present)
With Chrome: if you open the Developer Tools (F12), on the Network tab you can check the Disable cache checkbox, which turns off caching, while the DevTools is open.
With Firefox: if you open the Developer Tools (F12), click the cogwheel icon ("Toolbox Options"), then in the "Advanced Settings" section, check the Disable Cache (when toolbox is open) checkbox.
Now there will be no caching in the browser. Might slow down stuff seriously...

Magento - import - Get an error just after clic on save and continue to edit

My data was move from another server by the team who host my website ( www.whc.ca) and now when i go in the section:
system -> import/export -> CommerceExtension
when i open a import with out add any file just clicking save and continue i get this message:
Invalid POST data (please check post_max_size and upload_max_filesize settings in your php.ini file).
I don't get this from any other files in the system -> import/export
I talk with the guy how program this extension and he said that there is nothing in his program that bring this error.
The guys who doing the technical support on WHC do not know how to fix it. It was fix once when i was on the other server but there was no note about how it was fix.
some one made this for me: http://djinncomics.com/phpinfo.php
Can some one know what can cause that or where to look? true the Cpanel i already configure the limit and i modify the php file ether. nothing seem affect this error message.
I assume your import/export extension is certainly overloading some of Magento classes. I got the same error today and checked the code, here is what appear to be the problem, in file app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php :
/**
* Save profile action
*/
public function saveAction()
{
if ($data = $this->getRequest()->getPost()) {
...actions...
}
else {
Mage::getSingleton('adminhtml/session')->addError(
$this->__('Invalid POST data (please check post_max_size and upload_max_filesize settings in your php.ini file).')
);
$this->_redirect('*/*');
}
}
When you try to save an import/export profile and don't change any param, Magento will automatically assume that you have a problem with your server configuration, which is not the case.

how to debug the js in jsfiddle

I am looking at this jsfiddle: http://jsfiddle.net/carpasse/mcVfK/
It works fine that is not the problem , I just want to know how to debug through the javascript. I tried to use the debugger command and I cant find it in the sources tab?
any idea how I can debug this?
some code from the fiddle:
angular.module('app', ['appServices'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/home', {templateUrl: 'home.html', controller: HomeCtrl}).
when('/list', {templateUrl: 'list.html', controller: ListCtrl}).
when('/detail/:itemId', {templateUrl: 'detail.html', controller: DetailCtrl}).
when('/settings', {templateUrl: 'settings.html', controller: SettingsCtrl}).
otherwise({redirectTo: '/home'});
}]);
The JavaScript is executed from the fiddle.jshell.net folder of the Sources tab of Chrome. You can add breakpoints to the index file shown in the Chrome screenshot below.
Use the debugger; statement in the code. The browser inserts a breakpoint at this statement, and you can continue in browser's debugger.
This should work atleast in chrome and firefox.
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/debugger
angular.module('app', ['appServices'])
.config(['$routeProvider', function($routeProvider) {
// *** Debugger invoked here
debugger;
$routeProvider.
when('/home', {templateUrl: 'home.html', controller: HomeCtrl}).
when('/list', {templateUrl: 'list.html', controller: ListCtrl}).
when('/detail/:itemId', {templateUrl: 'detail.html', controller: DetailCtrl}).
when('/settings', {templateUrl: 'settings.html', controller: SettingsCtrl}).
otherwise({redirectTo: '/home'});
}]);
Something worth mentioning. If you are ever using chrome dev tools. Press ctrl+shift+F and you can search through all the files in the source.
In addition to the other answers.
Very often it is useful just write debug information into the console:
console.log("debug information here");
The output is available in browsers dev tools console. Like it was logged from the usual javascript code.
This is quite simple and effective.
Adding a debugger statement in the code and enable the "Developer Tools" in the bowser.
Then when you are running the code in JSFiddle, the debugger will be hit!.
One of the answers above works but just that you need to add the keyword debugger at the line you want the break points and run the code which will then fire them on the dev tool. The code then gets visible at the source tab under editor_console=true.
Here is another place :)
Under the Jsfiddle.net node.
The JavaScript is executed from the file ?editor_console=true in the folder result (fiddle.jshell.net)/fiddle.jshell.net/_display folder of the Sources tab of Chrome when using the developper tool. You can add breakpoints to your code then and refresh the page.
More information on using chrome debugger can be found at Trying to debug Javascript in Chrome

Reset Password Link Joomla - While in "maintenance mode" / offline mode

How do users reset passwords while in "off-line" mode.
We are running the site as Intranet.
Joomla 2.5.4
Mhm.. this is quite long to do, but maybe you can work it out.
Grant your user level offline access (you can do that in Global configuration -> Permissions)
Create a menu entry that point to the user profile and set visible to your users
Set every menu/modules etc etc invisible to "normal" users (except the previous one)
I've never tried it before, but it should work.
I just wanted to share my solution for Joomla 3.9:
In the file "offline.php" of your template (or in /templates/system if the template has no offline.php) you can place this code before where the login form is displayed:
if( JRequest::getVar('option') == 'com_users') {
?><jdoc:include type="message"/><?php
$registrationController = new UsersController();
$registrationController->display();
} else {
// Login Form
}
so it displays the dialogs to reset the password if the page is loaded by using "index.php?option=com_users&task=request.reset" or similar, but shows the "offline" login form by default.

How do I disable the Symfony 2 profiler bar?

It's not adding anything and it makes the page slower and I want it gone. Don't ask. There's little about the profiler on the website and nothing in the app config.
This setting is in app/config/config_dev.yml:
web_profiler:
toolbar: true
intercept_redirects: false
Additional: if you want to disable it for a special action in your controller than use this:
if ($this->container->has('profiler'))
{
$this->container->get('profiler')->disable();
}
If you set framework.profiler.collect to false in your config.yml, the profiler bar won't be shown (even if web_profiler.toolbar is set to true).
framework:
profiler:
collect: false
This then allows you to selectively activate collectors in your code manually, like this:
$this->container->get('profiler')->enable();
Documentation here: http://symfony.com/doc/current/reference/configuration/framework.html#collect
If you have created a new Symfony project since Symfony 2.5, these parameters are set in app/config/paramaters.yml
parameters:
# ...
debug_toolbar: true
debug_redirects: false
Just set debug_toolbar to false.
Symfony 5.3.7
I changed the toolbar value to false in the web_profiler.yaml and the toolbar was disabled.
{# [root_directory]/config/packages/dev/web_profiler.yaml #}
web_profiler:
toolbar: true --> Change to false
intercept_redirects: false
Try this
framework:
profiler: { only_exceptions: true }
in your app/config/config_dev.yml
To still get output in /_profiler but without the toolbar, you can cheat:
$request->headers->add(array('X-Requested-With' => 'XMLHttpRequest'));
That's because in WebProfilerBundle/EventListener/WebDebugToolbarListener.php there's an explicit check for this before injecting the toolbar.
If you are worried about performance - then you should not be running under dev. Dev also limits caching and can pull in additional bundles.
Run in prod mode and warm your cache before you run performance tests.
Another way that seems to disable it, is to not have _dev in the routing of the application.
So for me in a bitnami install of Symfony 2, simply by changing app/conf/httpd-app.conf slightly it would change the program:
RewriteBase /symfony/app_dev.php
to
RewriteBase /symfony/
and it would keep the toolbar from coming up.

Resources