? Pending

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
17 Jan 2017

Pull Request for Issue # .
Nobody asked for this.

Summary of Changes

  • Render the debug console using layouts
  • Write sql log to a .php file, not a .sql file
  • Break up all log files by option/view/etc.

Testing Instructions

Turn on debugging. Expect the debug console to work the same as it does without the patch.
Turn on logging (in the plugin settings). 'Deprecated' and 'Everything' logs should now be stored in different files for each site/option/view/layout. Sql Query log files should end in .php because (without some specific server settings) .sql files could be shown to anyone who knows how to find them and may contain sensitive information that should not be made public.

Documentation Changes Required

Probably not?

Why?

I realize this is kind of a strange PR. Maybe nobody thinks there's much use in using layouts for this when the plugin alone is already working just fine. There are a few good reasons maybe. For one, it greatly reduces the amount of code in the main plugin file making what remains a lot easier to comprehend. Also, it has the benefit that layouts always have which is that they can be easily overridden. Maybe overriding the debug console is not a big priority for most people but I think there can be some good reasons to do so.

I also think there are several things about this plugin worth examining in more detail. One is the way sql logs are written and overwritten. Another is the question of whether it's appropriate for this plugin to be configure log files at all.

Anyway, I don't expect this to be merged right away but let's discuss it a bit and see what else can be improved.

avatar okonomiyaki3000 okonomiyaki3000 - open - 17 Jan 2017
avatar okonomiyaki3000 okonomiyaki3000 - change - 17 Jan 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jan 2017
Category Layout Front End Plugins
avatar okonomiyaki3000
okonomiyaki3000 - comment - 17 Jan 2017

OK...so in serious need of a rebase here. Not today though.

avatar okonomiyaki3000 okonomiyaki3000 - change - 19 Jan 2017
Labels Added: ?
avatar okonomiyaki3000
okonomiyaki3000 - comment - 19 Jan 2017

Looks like some nice new stuff was added since I started all this. Should be integrated now.

avatar csthomas
csthomas - comment - 19 Jan 2017

You have to fix code styles. Click on the red "X" above in list of commits and next on the "Details". Then click on the red test on the next page.
Direct link: https://travis-ci.org/joomla/joomla-cms/jobs/193430713 and scroll down.

avatar zero-24
zero-24 - comment - 19 Jan 2017

@okonomiyaki3000 @csthomas i have reviewed the files from a CS perspective. I hope i have fixed the most errors. We just need to wait for travis to check it again than i can come back to fix them too ?

avatar csthomas
csthomas - comment - 19 Jan 2017

If you have more time then you can fix year 2016 to 2017

 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
avatar zero-24
zero-24 - comment - 19 Jan 2017

@csthomas this is done by the build script. there is no need to fix that manualy ?

avatar csthomas
csthomas - comment - 19 Jan 2017

Good to know:)

avatar zero-24
zero-24 - comment - 19 Jan 2017

@okonomiyaki3000 is green now.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 20 Jan 2017

@zero-24 Thanks!

avatar zero-24
zero-24 - comment - 21 Jan 2017

with the patch applyed:
image

whithout the patch applyed;
image

settings of the plugin:
image

avatar zero-24
zero-24 - comment - 21 Jan 2017

So it looks like there are still some issues with that PR ?

avatar okonomiyaki3000
okonomiyaki3000 - comment - 22 Jan 2017

@zero-24 Why are you showing this pane of the plugin settings? It has nothing at all to do with the content of the debug console.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 22 Jan 2017

Also, we see text changes (Profile Information => Profile) but I don't remember making changes to the language files. So I'm kind of curious how that happened.

avatar zero-24
zero-24 - comment - 22 Jan 2017

The point i have is that after the PR some tabs are gone (e.g log messages)

avatar okonomiyaki3000
okonomiyaki3000 - comment - 22 Jan 2017

Certainly. But, in your unapplied example, do those tabs actually contain any information? I guess not. The patched version omits unnecessary tabs.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 23 Jan 2017

Ah, I see. You might have thought that turning on logging in the plugin settings' "Logging" tab would make log messages appear in the debug console. This is not correct. It's a confusing (and I think kind of stupid) thing about this plugin. The "Logging" tab has absolutely nothing to do with the output in the debug console. Switching those logs on causes log files to be written. If you want logs to show in the debug console itself, the settings are in the "Plugin" tab.

Actually, I really think the options in the "Logging" tab are bad. First of all, they are confusing because you think of this plugin as being associated with the debug console, not log files. Second, the options here are kind of limited and strange. If you really cared about logging, you'd want more flexible options that this. Basically, I think there should be a plugin devoted to log configuration which should give a lot better control over this stuff. Weirdest and worst of all, "Log Executed Queries" writes a file with a .sql instead of .php extension meaning that your web server will most likely serve it as-is to anyone who can guess the path. Since it contains a bunch of queries, it's not hard to imagine that some information may be in there that you didn't want to share with the public. Also, unlike normal log files, these sql logs get overwritten completely instead of appended to. Ah, and (for some reason) the queries in these files have all instances of backtick removed (which could be a problem for several reasons). This PR does change the file extension of the sql log to .php but I don't deal with the other issues.

avatar zero-24
zero-24 - comment - 23 Jan 2017

Certainly. But, in your unapplied example, do those tabs actually contain any information? I guess not. The patched version omits unnecessary tabs.

They not contain everytime info but i have produced some errors and the tabs are there but not correct see:

Without the Patch:
image

With the patch:
image

To reproduce the errors replace this file: /administrator/language/en-GB/en-GB.com_cpanel.ini with:

; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

COM_CPANEL="Control Panel"
COM_CPANEL_HEADER_SUBMENU=Submenu"

And go to the com_postinstall backend view.

This produces a parsing error (missing " before Submenu) and a missing string error as the most of the postinstall language strings for the messages are missing.
After this patch the parsing error is not detected and the missing string view looks strange m<be there is just a div missing or similiar.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 23 Jan 2017

@zero-24 Thanks! I'll try that.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 1 Feb 2017

This is all good now, right? Any other issues?

avatar csthomas
csthomas - comment - 11 Feb 2017

I would test it if you fix conflict.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Feb 2017

@csthomas looks like Conflicts are fixed.

avatar zero-24
zero-24 - comment - 22 Feb 2017

hmm i'm confused.

this is before and after the patch:

With the patch
with_patch

without the patch:
without_patch

it looks like the ordering is different?

How to reproduce

  • com_patchtester pulls view.
  • /370b2/administrator/language/en-GB/en-GB.ini ->
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

; Common boolean values
; Note: YES, NO, TRUE, FALSE are reserved words in INI format.

; Keep this string on top
JERROR_PARSING_LANGUAGE_FILE="&#160;: error(s) in line(s) %s"

J1=1"
J2="2"
J3="3"
avatar okonomiyaki3000
okonomiyaki3000 - comment - 23 Feb 2017

@zero-24 Interesting. Offhand I don't know exactly why they order should be different. Does it matter at all?

avatar zero-24
zero-24 - comment - 23 Feb 2017

it is not about the ordering. After the patch we miss 2 strings.

image

And can we please add two spaces after the # so we get back

# JRoot/... :)

avatar okonomiyaki3000
okonomiyaki3000 - comment - 23 Feb 2017

OK, I'll try to look into it soon.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 16 May 2017

After rebasing with the latest staging, I couldn't duplicate the issue. If it still exists, let me know.

avatar csthomas
csthomas - comment - 21 Oct 2017

I tested it at J3.7.2 and this PR has a few issues. I created a mistake in language file administrator/language/en-GB/en-GB.ini to see parsing error log.

  1. 95 Queries Logged instead in old version 32 Queries Logged
    Real queries are 32.

  2. There are PHP Notices on lines in database queries:

30.
**Query Time: 0.47 ms** **After last query: 0.47 ms** **Query memory: 0.033 MB Memory before query: 3.113 MB** **Rows returned: 20**

SELECT m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element, m.menutype

  FROM j37_menu AS m

  INNER JOIN j37_extensions AS e 
  ON m.component_id = e.extension_id

  WHERE m.menutype = 'main' 
  AND m.client_id = 1 
  AND m.id > 1 
  AND e.enabled = 1

  ORDER BY m.lft

**Explain**

Notice: Undefined index: Duration in /.../layouts/plugins/system/debug/tabletohtml.php on line 20

Notice: Undefined index: Duration in /.../layouts/plugins/system/debug/tabletohtml.php on line 20
  1. On untranslated tab (please do not remove space after hash):
  • before: # JROOT/libraries/cms/html/html.php
  • after: #JROOT/libraries/cms/html/html.php
  1. White separate lines between tabs (before and after), this is not important but I like them:
    before
    after

The memory usage is better ?

Can you fix conflict and fix above problems? I would like to see this PR merged in Joomla 3.

avatar csthomas
csthomas - comment - 12 Dec 2017

Ping, @okonomiyaki3000 do you find a little time to resolve the conflict and check my above comment?

avatar okonomiyaki3000
okonomiyaki3000 - comment - 12 Dec 2017

@csthomas OK, I should be able to spend some time on it this week.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 19 Dec 2017

I've started working on this but it will take some time to integrate the changes.

avatar csthomas
csthomas - comment - 25 Jan 2018

How do you do? Any news?

avatar okonomiyaki3000
okonomiyaki3000 - comment - 26 Jan 2018

How about if I close this PR for now and maybe put in a different one later after taking some time to figure out what needs to be done?

avatar csthomas
csthomas - comment - 26 Jan 2018

OK, but please do not delete your branch okonomiyaki3000:render-debug-with-layouts.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 29 Jan 2018

@csthomas lol, ok.

avatar roland-d
roland-d - comment - 22 Jul 2018

Should we consider this superseded by #20380 ?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13622.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 22 Jul 2018

Yeah, seems like it.

avatar okonomiyaki3000 okonomiyaki3000 - change - 22 Jul 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-07-22 23:53:09
Closed_By okonomiyaki3000
avatar okonomiyaki3000 okonomiyaki3000 - close - 22 Jul 2018

Add a Comment

Login with GitHub to post a comment