Jump to content
adrian

Tracy Debugger

Recommended Posts

13 minutes ago, adrian said:

There is one outstanding one on his local Windows dev setup that I can't reproduce at all and he also isn't seeing on a live server. He is getting session_start / headers already sent error.

After testing on a few more local sites I can't reproduce the error, so must be something specific to that one site and nothing to bother with.

But one new issue I noticed is that it seems Adminer expects its root url to always include a query string. So in the Tracy implementation it can form invalid URLs that lead to a 404. For example, the link back to the database view:

2018-11-01_140253.png.1bf4838d28996bed0f1b2b7326889449.png

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, adrian said:

Quick note to let you know that it's also possible to run Adminer directly via: /processwire/setup/adminer/ which may be preferable if you have lots of work to do and want it open in a more "permanent" way. At the moment I set the page as hidden so it actually won't appear under the Setup menu - I can change this, or perhaps I can have a link from the Adminer Tracy panel to open it this way. Any thoughts on which would be best?

I think it would be good to add this - I'd use it. Either option would be okay, but my preference would be to see Adminer in the Setup menu.

  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, Robin S said:

but my preference would be to see Adminer in the Setup menu.

Done, although just realized I should tweak this so that the PW menu system is retained - coming soon 🙂

 

10 minutes ago, Robin S said:

But one new issue I noticed is that it seems Adminer expects its root url to always include a query string.

I'll look into this shortly.

Share this post


Link to post
Share on other sites
35 minutes ago, adrian said:

There is one outstanding one on his local Windows dev setup that I can't reproduce at all and he also isn't seeing on a live server. He is getting session_start / headers already sent error. 

Could someone else on Windows (maybe @bernhard) take a look and let me know if you have the same problem as well.

Seeing the warning here as well. Tested on Win 10. Will try tomorrow on Win 7 but I don't think there will be a difference. Issue seems to be session_use_cookies, whether 0 or 1 and/or not ob_start() and ob_flush() at the very top and very end respectively...

Edited by kongondo
  • Like 2

Share this post


Link to post
Share on other sites
23 minutes ago, adrian said:

Done, although just realized I should tweak this so that the PW menu system is retained - coming soon

Personally I'd rather open Adminer in a new tab and have the whole screen dedicated to it. Is there a way you could make it configurable whether to have the PW menu or not? Or perhaps there could just be a small link back to the PW admin root?

  • Like 1

Share this post


Link to post
Share on other sites
52 minutes ago, Robin S said:

But one new issue I noticed is that it seems Adminer expects its root url to always include a query string.

I have this fixed in the Adminer panel version, but struggling to get it sorted in the Setup > Adminer version. Not sure I'll get this sorted tonight before I leave I'm afraid.

34 minutes ago, Robin S said:

Personally I'd rather open Adminer in a new tab and have the whole screen dedicated to it.

I'll just leave it this way for now then - will tweak when I am back if needed.

  • Like 2

Share this post


Link to post
Share on other sites
22 minutes ago, adrian said:

Not sure I'll get this sorted tonight before I leave I'm afraid.

No worries. Big thanks for adding Adminer to Tracy and enjoy your time away.

  • Like 3

Share this post


Link to post
Share on other sites
7 hours ago, kongondo said:

Will try tomorrow on Win 7 but I don't think there will be a difference

I can confirm same warning  on Win 7.

  • Like 1

Share this post


Link to post
Share on other sites

And it is really messing up the interface...I'll try and Google the issue when if I get a moment..

Share this post


Link to post
Share on other sites
3 minutes ago, adrian said:

@kongondo and @Robin S - can you please try the attached version to see if that fixes those errors on Windows please?

 

ProcessTracyAdminer.module

Sorry, still doesn't work.

 

Quote

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at ....\site\modules\TracyDebugger\panels\Adminer\adminer-4.6.3-mysql.php:151) in .....\site\modules\TracyDebugger\panels\Adminer\adminer-4.6.3-mysql.php on line 71

 

Share this post


Link to post
Share on other sites

I just installed the version from github and I don't see any errors on chrome/win10... Let me know if I can help with debugging.

Share this post


Link to post
Share on other sites

I'm on the road now so can't help much but interesting @bernhard isn't having issues. Also weird that the file is referencing itself regarding the headers sent stuff. That said I can't see it being a core Adminer issue either. Hopefully you guys can help to figure it out for me 😊

Share this post


Link to post
Share on other sites

@adrian when you get back, please take into account $config->dbPort setting. I'm using non-standard port and this should be honored in ProcessTracyAdminer.module something like that:

$port = wire('config')->dbPort ? ':'.wire('config')->dbPort : '';
...
new AdminerProcessWireLogin(wire('config')->dbHost.$port, wire('config')->dbUser, wire('config')->dbPass, wire('config')->dbName),

 

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, kongondo said:

I can confirm same warning  on Win 7.

I think I might have found the source of this issue. It seems to relate to debug mode in /site/config.php. When debug mode is on I get the session warning and when it is off I don't. Can you confirm @kongondo?

20 hours ago, adrian said:

I have this fixed in the Adminer panel version

@adrian, this fix isn't working reliably for me. If I visit the "MySQL" root item in the breadcrumbs, then browse into a database table, then click the database name in the breadcrumbs I get a 404. I wonder if the simplest thing might be to reverse your previous fix and make a small modification to adminer-4.6.3-mysql.php: on line 531 change "&db=" to "?db=". Seems to work well here for both the Process module and the panel.

BTW, the adminer-4.6.3-mysql.php file is pretty horrible. I get why the project owner wants to compile everything into one file but it results in some weird encoding (PhpStorm gives encoding warnings when the file is opened and is liable to auto-save the file and mess it up in the process) and it's very difficult to debug. Do you think it would be feasible at all to do a custom compilation of the source to make it a bit more readable and leave out the lzw compression? 

  • Like 2

Share this post


Link to post
Share on other sites
46 minutes ago, Robin S said:

I think I might have found the source of this issue. It seems to relate to debug mode in /site/config.php. When debug mode is on I get the session warning and when it is off I don't. Can you confirm @kongondo?

Spot on!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks everyone for the debugging. Would someone (maybe @Robin S) mind putting together a PR with his suggested fix for the &db issue and if you wouldn't mind also @matjazp's request for a custom port. I can easily merge a PR on my phone but not keen on coding ☺

Share this post


Link to post
Share on other sites

PS - I'll take a look at the possibility of custom compiling when I'm back. Also do you have any ideas on how to get around the debug mode issue? 

Share this post


Link to post
Share on other sites
26 minutes ago, adrian said:

Would someone (maybe @Robin S) mind putting together a PR with his suggested fix for the &db issue and if you wouldn't mind also @matjazp's request for a custom port.

Done.

23 minutes ago, adrian said:

Also do you have any ideas on how to get around the debug mode issue?

Not sure, but I wonder if it's related to the PHP notices from Adminer & plugins I mentioned earlier in our PM conversation. Maybe with debug mode on the error reporting level changes and those notices are being output somewhere before session start.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for the PR. Maybe we need to get those plugins cleaned up. I'll take a look when I can unless you beat me to it☺

Share this post


Link to post
Share on other sites

@Robin S - I wonder if a simple temporary solution might be to turn off error reporting at the top of the Adminer process module file?

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, adrian said:

I wonder if a simple temporary solution might be to turn off error reporting at the top of the Adminer process module file?

Yep, works well here. New PR made.

  • Like 1

Share this post


Link to post
Share on other sites

No idea, but maybe these informations are helpful: I'm using SessionDbHandler, error reporting E_ALL, laragon, win10; no warnings, no errors;

I think it would be great to have the PW logo besides the Adminer logo so that one can go back to the PW admin if one uses the adminer process module from Setup > Adminer (which I prefer).

Edit:

<a href="/admin/" style="float:  left;">
<img src="/wire/modules/AdminTheme/AdminThemeUikit/uikit/custom/images/pw-mark.png" alt="Back to ProcessWire" style="
  height: 22px;
  margin: 5px;
  margin-right: 5px;
  margin-left: 10px;
">
</a>

BzYBtpP.png

And on smaller screens:

8kJvDeb.png

Does anybody know how to inject that into <div id="menu"> ? Maybe some hints @adrian then I can do a PR - just don't know where to inject it properly 🙂

Share this post


Link to post
Share on other sites

@bernhard - there is a name () method from Adminer which I think will handle this. Only catch might be not wanting it in the panel version? 

Share this post


Link to post
Share on other sites
7 hours ago, Robin S said:

Yep, works well here. New PR made.

Thanks @Robin S PR merged and modules directory updated. 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild. 
      EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Optional step value (Read more) Optional manual override of the selected value (will still adhere to the rules above) Configurable rounding of manually entered values (floor, round, ceil, disable) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant  
      Changelog
      005 (current version)
      - Fix bug where the Inputfield would not work properly within repeaters / repeater matrices
      004
      - Make rounding of manually entered values configurable (floor, round, ceil or disable)
      - Fix small JS bug when the value-display field was not displayed
      - Update README
      003
      - Code cleanup, add some ModuleInfo data & LICENSE
      - Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/)
      002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional
      001
      - Initial release
       
      Thanks!
       
       
    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...