Hi Guys I am getting a blank page and also redirect to assigned role page after clicking Add New User --> System --> Permissions --> User --> Add New User.I checked log, report,exception error file, didn't find any error even it enabled. I cannot add new user.Can someone please point me in the right direction, that would be great.
Thanks in advance.
The error has been fixed by changing content of core function getRowUrl in app\code\core\Mage\Adminhtml\Block\Widget\Grid.php
The core function :
public function getRowUrl($item)
{
$res = parent::getRowUrl($item);
return ($res ? $res : '#');
}
Replaced with:
public function getRowUrl($item)
{
return $this->getUrl('*/*/edit', array('id' => $item->getId()));
}
It worked great.
This is a type of question I have asked before and it was shut down for being to vague.
I know how frustrated you feel since it is impossible to find a solution on the net.
My experience has since taught me that if I get a blank page, it probably means my working environment, webserver, IDE etc has just got too heavy.
My advice:
Restart your apache server
check Firefox is not eating too much memory in the Task Manager
Likewise with your IDE.
Also watch out for the resources being used by the JAVA JAR used by your IDE
Turn off XDebug since it has memory leaks.
Setup a cron to restart apache every hour.
Dont forget to clear the cache too!
Related
I have a very special problem and I don't know how to deal with it.
I have web App in Laravel, when i open index page, I receive text message to my mobile phone.
Problem is, sometimes I receive 2 messages or 3, sometimes 1.
Is there a tool how to debug this strange behavior which is not always the same?
A few words about my code:
user opens the page, and because its first visit Session doesn't have attribute message_sent and SendTextMessage::SendMessage($phoneNumber, $id_message, $smsCode, $newDateFormat); is executed. After that Session has message_sent and can't be sent again, for example if I refresh the page.
SendTextMessage::SendMessage() is Class in Laravel Helpers.
controller code:
public function index($url_attribute, $id_message, Request $request)
{
if(!Session::has('message_sent'))
{
$user = User::where('id_message', $id_message)->first()->toArray();
$phoneNumber = $user['mobile_phone'];
$smsCode = $user['sms_code'];
$newDateFormat = date("d.m.yy", strtotime($smsExpirationTime));
$request->session()->flash('message', 'Text message sended.' );
SendTextMessage::SendMessage($phoneNumber,$id_message, $smsCode, $newDateFormat);
Session::put('message_sent', true);
}
return view('login');
}
SendTextMessage Class:
class SendTextMessage
{
public static function SendMessage($phoneNumber, $id_message, $smsCode, $newDateFormat)
{
$sms = new Connect();
$sms->Create("user","pass",Connect::AUTH_PLAIN);
$sms->Send_SMS($phoneNumber,"Message");
$sms->Logout();
}
}
Many thanks for any tip or help.
UPDATE:
problem is only in Chrome.
Edge and internet explorer are fine.
As this script runs on server-side the browser shouldn't be an issue. Based on your code provided, there is no clear answer to give here.
Please try the following in order to debug your problem:
Log messages at each stage of the script in order to see which part was called how often. That will help you to locate the problem. You can use \Log::error("Message") to do that.
Once you know where the problem might be, try to log "decision" making / mission critical variables to logile as well. E.g. \Log::error($session) so that you can understand why that problem might occur. One reason could be that you have a bad configured session caching or your cookies might be messed up. At some point there is probably a piece of data not the way you expect it to be.
You should maybe try to change the way you use Laravel Session.
You indicated that it was working fine on some browsers, that means your server-side code is correct so far, but there is someting messing with Chrome… From there,
if you take a quick look at the Laravel Session doc, you'll see that Session can be stored in cookies, and I bet that this is your actual setup (check in your .env file the SESSION_DRIVER constant, or in your config/session.php file).
If so, to confirm that this cookies-based session setting is the culprit, you might want to change the Session config to make it browser-independent: any other option than cookies will work, the database or file options might be the easier to setup… And if it works I would strongly encourage you to keep using this no-cookie setting to make your code browser-safe.
I want to upload ad image to ad revive server, when i create or update d banner.
when i click to save changes page will response the The connection time out.
.
I try to change the file permissions 0755 to 0777. but sill i can upload/change ad image.
Log Output (debug.log):
May 13 21:15:36 +0000 OX-5af8aaf8338bc [ warning] Declaration of HTML_QuickForm_file::_findValue() should be compatible with HTML_QuickForm_element::_findValue(&$values)
I can't understand the above log output.
Please help me to understand and debug.
Thanks
The warning you paste is because the class being used is overriding a static function _findValue, and declares it differently than the parent class.
You can get rid of that warning by changing the line in the child class (probably given by the warning: "in file... at line...") from
public (or protected) static function _findValue() {
to
public (or protected) static function _findValue(&$values) {
As for what is causing the timeout, I'm afraid there are just too many possibilities. Try inspecting the communication using Firefox or Chrome Web Developer Tools, see whether anything comes up.
Failing that, you'd need to debug the server, either by using a developer setup (IDE plus remote debugger, say XDebug or Zend) or the old fashioned, plodding way by inserting die() statements along the execution path. Both require some experience and some time. If you've never done it, I'm afraid you need to find someone who can.
I'm facing weird problem which a bit complicated to understand. So the situation is that:
we have 2 installs (actually more, but not relevant for now)
both installs places on same server (apache + nginx)
we update our code and therefore deploy to staging - first install works great, second one has problem.
the code is 100% percent the same
there is no influence of other plugin (wordpress) on the specific part of code
The relevant code is the following:
$track = new trackClass();
$track->store_parameters();
$parameters = unserialize($track->parameters);
class trackClass // this class sits on different file
{
public $parameters;
public function __construct() {
...
}
method...
method...
method ..
public function store_parameters()
{
...
}
}
Before we modify our code, the function store_parameters was private, now its public.
So when on the second install the code is running its raise an error that the store_paramters() function is private and not accessible (remind you that it happens only on the second install).
I tried another thing get_class_methods($track) and the response was all the methods except the store_parameters(). Again - weird.
Next step, put wp_die('test') in the top of the file of the class. Refreshing the page and all as usual (the file is definitely loaded). If I try to access the admin (wp-admin) the changes make difference - the page is killed, blank screen and 'test' on it.
Next step, remove this file completely from the server. Refreshing the page and nothing happen. Their is ajax request from the class file which run as usual, like the file is exists and everything is ok. Again, going to the admin page and the error is raised (require_once ... not found).
Its doesn't seems like its code or development problem. The code is same. I'm afraid that its something on the server side / environment (apache, nginx) but unfortunately I've no access to the linux, I only can chat with the support of the hosting company.
They are insists that is code problem. No matter the tests I wrote above.
What can cause this kind of problem? I'm losing my mind here with no lead, its like the file is stuck somewhere.
I am making changes in my theme templates in OpenCart 3. Due to template caching I have to clear cache every time under "storage/cache" directory. It is very annoying when working and previewing changes frequently during development. Please provide some solution how we can configure caching according to production and development environment.
Note: I have already searched for solutions online but there is no solution related to template caching. Solutions are available to disable image caching but "Image Caching" and "Template Caching" are different features provided in Opencart.
You might need to upgrade to a more recent version of OpenCart3 - the first one (3.0.0.0) didn't have a way of doing this in the GUI.
More recent versions, such as 3.0.2.0, have a gear on the admin dashboard. Click the gear and you get options to disable caching.
Another way to do this:
Open to system\library\template\Twig\Cache\Filesystem.php, find following lines of code
public function load($key)
{
if (file_exists($key)) {
#include_once $key;
}
}
Comment out as in the following code:
public function load($key)
{
// if (file_exists($key)) {
// #include_once $key;
// }
}
This will remove the template cache of the twig and recreate every time, once development is over you have to remove the comment.
You can also do this from CODE directly if you have the access. Go to this file path below via ftp or cPanel:
system\library\template\Twig\Environment.php
Find
$this->debug = (bool) $options['debug'];
Replace:
$this->debug = (bool) true;
Opencart Version 3.0.2.0
I was having same problem, try working in theme editor or the actual raw twig file, after an hour or two i tried this it worked.
Delete the changes in theme editor and got back editing actual twig file
my screen shot
I think you edit the template as the path: Design->Theme Editor before.
Clear all of the date in the oc_theme data table of your database.
Scott's answer is best but in case it's not available due to version or you want to disable it programmatically you can do this anywhere before the twig is rendered:
$this->config->set('template_cache', false);
in OC 3.0.3.6, if you have some twig extension, like twig managers, after changes maded you should select that extention in modifications and refresh push button on top right corner.
P.S. loose whole day to find this, hope it helps someone
This is similar to Scott's answer but just on the database/backend. In case you can't rely on the UI and can only access the DB (like me, I'm messing up with the UI) it's on settings table search for 'developer_theme' key and set it to false or 0.
UPDATE `oc_setting` SET `value` = '0' WHERE `oc_setting`.`key` = 'developer_theme';
UPDATE -- working on getting WAMP with phpDeveloper/Xdebug going. I still want NetBeans -- I just want to compare, see if I get some insights.
I am using NetBeans 6.9 with LAMP and Xdebug to work on PHP code. The Variables display works well, but lately it works less well. For example below, $authorized should be visible in the variables pane below the code and should expose its value. But it doesn't show, nor its value, and mousing over the code doesn't help. (The $this object is showing and it does go on and on, but $authorized isn't in there, and it wouldn't make sense if it were.)
This behavior is consistent. Maybe it's a function of the complexity of the code? Or rampant object usage? it seems to have started when I took up CodeIgniter.
Of course the variables are hidden when I need them most ... or so it seems to the poor human. What am I missing?
NetBeans debugger http://themanthursday.com/wiki/Debugger_Display.png
There's a better example below. When I'm stepping through this code, Variables displays only Superglobals and $this, just as in the picture. I can't see any values, even mere strings.
(Nagging thought: I bet the $CI SuperObject has something to do with all this ...)
class Product_documents {
function getProductImage_all($id)
//Return an array of all documents for this product
{
$imgPath = $this->_getProductImage_folder($id);
$arrayPossibleFilenames = $this->_getProductImage_possible_files($id);
foreach ($arrayPossibleFilenames as $imgFile) {
$imgPathFull = $imgPath.$imgFile;
$file_exists = get_file_info($imgPathFull);
if ($file_exists)
{
$arrayFilesPresent[] = $imgPathFull;
}
}
return $arrayFilesPresent;
}
}
Right click on the variable pane. Select "Filters". You will find the secret.
Came across this site that has a very nice link to an Xdebug page that walks one through the process of upgrading Xdebug by compiling a 'more latest' version:
http://icephoenix.us/php/xdebug-doesnt-show-local-variables-in-komodo-netbeans-or-eclipse-pdt/
Variables inside by objects/classes are showing up again! Yeah!
No watches, no 'this may make Xdebug freak out' messages - just good ol' variables that now fully expose the failure of my solution... (haha).
David
I've seen stuff like this before in Netbeans. I expect it's just a bug involving Netbean's interaction with XDebug. One possible workaround that I've seen before is adding a "Watch" for the variable that you can't see. For your example, you could go to the "Watches" tab and type in $authorized. It should show up once it has been set.
I think it comes down to the singleton pattern that is implemented in CodeIgniter as "Super Object". I never have restarted this project to test Kamal's idea. Shortly after he posted, I concluded the singleton was the reason (I did not try to guess whether Kamal has the solution or not). Thus my response to this post.
(2015) In php.ini under [xdebug], set xdebug.show_local_vars=1 if you want all the local variables in debug mode.
Try initializing $authorized to bool false.
I've seen Netbeans not show me variables initialized with a return value from a function without a doctype, but it's hit or miss enough to not be make a pattern out of.