Does FirePhp work well with FireBug 1.12.0? - php

I used firephp in my project well before yesterday.
After I upgrade Firefox to version 23.0.1 , the FireBug extension is upgraded to version 1.12.0 automatically, and I find firephp do not show the detail data in the console.
It still shows the brief data. I can not unfold it to see the detail.
I guess firebug changed the data structure, and the firephp need to be upgrade.

If you are impatient type you can do a quick fix yourself.
Open the FireBug xpi file with your favourite archive/zip manager. For linux users, you should find the file here:
~/.mozilla/firefox/[unique-id].default/extensions/firebug#software.joehewitt.com.xpi
Navigate to /content/firebug/console/ in the archive/zip manager and open consolePanel.js
Got to line 911 (this may differ slightly for minor version revisions). It should look like this:
this.filterMatchSet.push(group);
Add this before that line:
if (typeof this.filterMatchSet == 'undefined')
{
this.filterMatchSet = [];
}
Save your change to the archive and restart FireFox

Firefox 23.0.1 + Firebug 1.12.0 + FirePHP 0.7.2 - the same versions set and the same problem... I checked FirePHP forum and there is a topic about this issue. Add-on author wrote there
Will take a look in early September after I return from vacation. Thanks for reporting this issue.
so in few weeks problem will be resolved I hope. :)

It appears that this issue with firePHP isn't being fixed any time soon and firebug has been updated again. Tom's answer does work but as he only specified a line number that part doesn't work in the newer version of firebug as the line numbers doesn't line up with the old ones SO here is how to find the correct place to insert Tom's code:
Follow Tom's answer here: https://stackoverflow.com/a/18530316/769294
Then when you have the consolePanel.js open you want to find this function:
filterLogRow: function(logRow, scrolledToBottom)
{
if (this.matchesFilter(logRow))
{
// Mark the groups, in which the log row is located, also as matched
for (var group = Dom.getAncestorByClass(logRow, "logRow-group"); group;
group = Dom.getAncestorByClass(group.parentNode, "logRow-group"))
{
Css.setClass(group, "contentMatchesFilter");
// #################################################################
// Add This line here
// #################################################################
if (typeof this.filterMatchSet == 'undefined') { this.filterMatchSet = []; }
// #################################################################
this.filterMatchSet.push(group);
}
}
.......
},
As you can see I have added some comments around the line you need to add (from Tom's answer) and you can see where it needs to go.
Hope this helps for all the updates to firebug in the near future until firePHP is fixed. :)

The problem is fixed with Firebug 1.12.3.

Related

Disable Undefined Property error in PHP Devsense extension on VSCode

I just added the PHP extension by Devsense to my VSCode and now it's lighting up like a Christmas tree. I want to disable the Intellisense option for unknown/undefined properties.
Here is the issue
and the error message
Undefined property: MY_Model::$load PHP(PHP0416)
And a link to the post where they talk about adding it
I saw some options for Intelliphense where you could set "intelephense.diagnostics.undefinedProperties": false
in the vscode settings.json, but I couldn't find anything that would work for this extension.
The fix described here in the 3rd post to add the property in a comment does work, but is not feasible in the codebases I am working in. I need something more like the second post, where I can just disable the check altogether
I found the answer to my own question. Leaving it here because It took me way too long.
You just have to exclude the error code, in this case error code 0416
1 - Open Settings.json : ctrl + shift + P and type 'settings.json'
2 - Select 'Open User Settings (JSON)
3 - At the end of file, add this code:
"php.problems.exclude" : {
"/" : [416],
"vendor/" : true,
}

Disable template caching for development in OpenCart 3

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';

JpGraph: LinePlot->SetWeight will not work

I am using JpGraph version 3.5.0b1 to create some graphs for a PDF document and I have hit a problem that has taken half of my day trying to work out whats going wrong.
All i want to do is change the line thickness of my lineplot but no matter what I try, it always defaults to 1 (assuming 1 is the default).
I have done my research and know that I have to set it after I add it to the graph and also that if antialias is set to true then SetWeight is ignored. My code follows these rules and yet still nothing. I am able to change the colour of the line so I know its nothing to do with how I'm calling the methods.
Can anyone help me here please? I would be hugely grateful as it is starting to annoy me just a tad.
Anyway, here is a little snippet of my code:
$lineplot = new LinePlot($ydata, $xdata);
$graph->Add($lineplot);
$lineplot->SetColor("red");
$lineplot->SetWeight(2);
SetWeight() will do nothing until you turn off anti-aliasing. JpGraph mentions this in their manual in the using anti-aliasing page.
I tested this in version 3.5.0b1 and the following must be done:
// Ensure anti-aliasing is off. If it is not, you can SetWeight() all day and nothing will change.
$graph->img->SetAntiAliasing(false);
// Create linear plot
$lineplot = new LinePlot($ydata, $xdata);
// Add plot to graph
$graph->Add($lineplot);
// Set line weight. This must be done AFTER adding the plot to the graph in version 3.5.0b1. I haven't verified this in other versions.
$lineplot->SetWeight(2);
I ran into this same thing, seems to be a bug with 3.5 as far as I can tell. It's even ignored in the examples distributed with 3.5.
Falling back to 3.0.7 works for me, so try that if you don't need any 3.5-specific features.
I had similar problem, resolved by using $p1->SetStyle('solid') AFTER adding the lineplot to the graph:
$p1 = new LinePlot($min_values);
$graph->Add($p1);
$p1->SetWeight(3);
$p1->SetColor("blue");
$p1->SetLegend("Minimum Values");
$p1->SetStyle("solid");
Here's a related link, validating Sean's recommendation to place the SetWeight and SetColor method calls AFTER calling the Add lineplot method.
The issue for me here is that my registered JpGraph version 3.5.0b1 does not seem to work at all concerning the line weight and also for other display switches.
After downgrading to version 3.1.7p, everything worked fine independent of any anti-aliasing switches or the positioning of SetWeight after Add().
Thus, at the very moment, I can only recommend downgrading to a non-3.5.0b1 version.

Add new user error in magento 1.5.0.1

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!

Browser performance question

Using an adapted version of jquery.inplace.js for some page creation and use an OBDC connection in the background php file to query for content. Everything works, BUT...
I am surprised that IE6, 7, or 8 are all pretty quick, as is chrome, but firefox seems to take quite a few seconds for exactly the same task, in this case.
This is without firebug, or lots of other add-ons enabled. I am puzzled by what to look for.
It is a fairly simple return of some html content.
What would you try?
A cursory look at the source in the SVN doesn't show anything which I believe firefox would have problems with.
Can you explain exactly what is "slow"? Is it the POST request? Have you tried logging the HTTP Headers sent to the server from both IE and FF?
If it's the javascript itself, try running the profiler in firebug; FF might find a specific function a little "heavy" (for instance, one of the regexes).
Also, FF3.5+ already has String.trim*() methods built-in. The code you're using overwrites those with a custom version, which will be much slower and might even be causing firefox to behave oddly. Try changing the source to the following:
if( String.prototype.trim === undefined ) {
String.prototype.trim = function() {
return this.replace(/^\s+/, '').replace(/\s+$/, '');
};
}
That way the plugin will only add the trim method for older browsers.

Categories