adrian

Module
Tracy Debugger

974 posts in this topic

4 minutes ago, adrian said:

so you can color by dev.mysite.com vs staging.mysite.com vs mysite.com.

+1 :P And thanks a million, as always...

Edited by szabesz
typo

Share this post


Link to post
Share on other sites

Not completely sure what happened, but i upgraded Tracy on a site running 2.7.3 and it killed the site. I fixed the permissions on all of the Tracy files which were set incorrectly after upgrade, but this didn't prevent the issue.

 

Error: Call to a member function queryString() on null (line 507 of ....wire/core/WireInput.php)
This error message was shown because you are logged in as a Superuser. Error has been logged.

1 person likes this

Share this post


Link to post
Share on other sites
Just now, Macrura said:

Not completely sure what happened, but i upgraded Tracy on a site running 2.7.3 and it killed the site. I fixed the permissions on all of the Tracy files which were set incorrectly after upgrade, but this didn't prevent the issue.

 

Error: Call to a member function queryString() on null (line 507 of ....wire/core/WireInput.php)
This error message was shown because you are logged in as a Superuser. Error has been logged.

Do you have the very latest version of Tracy - that PW 2.x problem was reported already and I fixed in in 4.0.1, unless it is occurring for some other reason as well.

1 person likes this

Share this post


Link to post
Share on other sites
32 minutes ago, Macrura said:

It's running 'version' => '4.0.4',

Thanks. Can you please try replacing lines 227 and 228 of TracyDebugger.module:

        // don't init Tracy for the PW Notifications module polling
        if(strpos($this->wire('input')->queryString(), 'Notifications=update') !== false) return;

with:

        // don't init Tracy for the PW Notifications module polling
        if($this->wire('input')) {
            $queryString = $this->wire('input')->queryString();
        }
        else {
            $info = parse_url($_SERVER['REQUEST_URI']);
            $queryString = $info['query'];            
        }
        if(strpos($queryString, 'Notifications=update') !== false) return;

 

Share this post


Link to post
Share on other sites

OK - thanks @adrian i will need to test this after 5pm (i think the owners are working in the admin so I don't want to crash the site during NY business hrs..)

1 person likes this

Share this post


Link to post
Share on other sites
Just now, Macrura said:

OK - thanks @adrian i will need to test this after 5pm (i think the owners are working in the admin so I don't want to crash the site during NY business hrs..)

No problem - thanks and sorry for the problems in the first place!

Just an FYI why this is happening. It turns out that I had to move lots of logic from ready() into init() to fix some more SessionHandlerDB issues. The problem is that $input seems to be available much earlier in PW 3 than it was in PW 2, hence the reporting of $input as null.

1 person likes this

Share this post


Link to post
Share on other sites

ok thanks for helping out so fast, and hopefully this will help prevent this type of issue for forward versions!

1 person likes this

Share this post


Link to post
Share on other sites

Hi everyone!

Introducing the new Style Admin by Server Type  feature. Hopefully this will reduce the chance of accidentally editing the wrong version of a site when you have more than one open in different tabs.

Firstly, a huge shoutout to @szabesz for the idea for this new feature and for lots of testing and suggestions to improve it. Also @tpr chipped in with some CSS help yet again!

This feature adds a ribbon down the side of the admin to let you know what version of the site you are on, eg. local, dev, staging, etc.

Screen Shot 2017-02-08 at 3.11.24 PM.png

 

Firstly you will need to enable it in the config settings. Then you'll want to set up your various server types and colors. It comes with the following defaults.

Screen Shot 2017-02-08 at 3.13.02 PM.png

 

If you don't like the side ribbon, you can actually style the output exactly how you want.

Screen Shot 2017-02-08 at 3.15.36 PM.png

 

2 people like this

Share this post


Link to post
Share on other sites

Hi Adrian,

those changes didn't fix the error;

Share this post


Link to post
Share on other sites
Just now, Macrura said:

Hi Adrian,

those changes didn't fix the error;

Let's take this to PM

Share this post


Link to post
Share on other sites

Admin styling: adding "pointer-events: none" could be useful I think.

1 person likes this

Share this post


Link to post
Share on other sites
On 2/9/2017 at 2:33 AM, tpr said:

Admin styling: adding "pointer-events: none" could be useful I think.

Hey @tpr - where do you think this should be applied? Sorry if I am missing the obvious :)

Share this post


Link to post
Share on other sites

To the recently added staging bar. In AOS for example it partly covers the sidebar so items loose hover state when you move the mouse over the bar.

1 person likes this

Share this post


Link to post
Share on other sites
4 minutes ago, tpr said:

To the recently added staging bar. In AOS for example it partly covers the sidebar so items loose hover state when you move the mouse over the bar.

Ok gotcha - I see how it helps now. I had a quick look and couldn't figure out what it achieved, but now I see and agree it's a little nicer. I wish there was a way to not have it partly cover the sidebar, but with those elements being absolutely positioned, I don't see an option. I think what I ended up with is a decent compromise though - it's narrow enough that it doesn't interfere, but is still obvious enough. If anyone has any better ideas I'd be happy to change.

2 people like this

Share this post


Link to post
Share on other sites

A few updates to the server type indicator ribbon:

  1. It's now possible to display it on the frontend as well. It might seem weird, but on occasion I have been looking at the frontend in the wrong tab (live vs dev) and wondering why my changes aren't doing anything :)
  2. You can now hide the indicator along with the Tracy debug bar when you use the hide icon.
  3. Here is the css to use if you'd prefer to have the indicator along the bottom:
body::before {
    content: "[type]";
    background: [color];
    position: fixed;
    left: 0;
    bottom: 0;
    color: #ffffff;
    width: 100%;
    padding: 0;
    text-align: left;
    text-indent: 5px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 29999;
    font-size: 15px;
    height: 22px;
    line-height: 22px;
    pointer-events: none;
}

which looks like this rather than the default sidebar. It is of course also fixed so it always visible when you scroll.

Screen Shot 2017-02-13 at 7.41.53 PM.png

3 people like this

Share this post


Link to post
Share on other sites

Another minor (but hopefully useful addition) - you can now use keyboard shortcuts to move between items in the console panel history stack.

Back: CTRL+CMD+↑
Forward: CTRL+CMD+↓

The up and down arrows are to mimic unix based terminal history shortcuts. Unfortunately I had to add the CTRL+CMD in there as well because it's hard to find a combination that isn't already used for something else, either by the browser or ACE editor.

Anyway, hope you will find it useful for speedy switching back and forward between snippets of code you have recently run.

2 people like this

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

Back: CTRL+CMD+↑
Forward: CTRL+CMD+↓

Thank you! I've been missing it :)

1 person likes this

Share this post


Link to post
Share on other sites

just popping by to say that Tracy made it possible for me to convert an old site where i was using direct output, to a delayed output model, which i needed to be able to handle the new requirements of the site; in particular, the template path feature was crucial – i was able to simply duplicate each template one at a time, rename to -dev, and work on the conversion until it was ready... Also the new styling looks great!

3 people like this

Share this post


Link to post
Share on other sites
1 minute ago, Macrura said:

in particular, the template path feature was crucial

Thanks for the feedback @Macrura - I have often wondered how much use the template path (and template editor) panels were getting. Glad to hear that it helped you out :)

Share this post


Link to post
Share on other sites

yeah, when i first started the conversion, i was basically scratching my head about how hard/complex it would be to change from direct to delayed; At some point along the way i remembered the tracy template path, and after that it just went really fast.. now that site's code has been completely refactored and it's so much cleaner!

1 person likes this

Share this post


Link to post
Share on other sites

Hi @adrian

Perhaps slightly off topic but...

I'd like to report that I had a recent differential backup that was growing rather fast, and it turned out to be tracy files in the session directory of the site. I've since excluded the offending session directory from the backup (shouldn't have been there in the first place) but it might be worth noting that the total size of all the tracy sessions files had grown into the 10s of GB. I wonder if there is any practical way Tracy could be made to cull its old session files?

Best wishes,
Steve

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By blynx
      Hej,
      just finished the first working version of my photoswipe bundle. https://github.com/blynx/MarkupProcesswirePhotoswipe
      As always any feedback is highly appreciated
      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      It is possible to customize pretty much anything by providing your own templates and scripts.
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen
    • By alexcapes
      Hi,
      I've been invited by Apple to use their 'News' service for a publication in the UK. https://www.apple.com/uk/news/
      A number of CMSs already have plugins to publish content via the API, however Processwire is not one (yet!)
      https://newsresources.apple.com/en/faq/66346243
      It's slightly beyond my technical abilities but would be very interested in anyone that is willing to look at developing a Processwire Module.
      (for reference here is the Apple News API documentation)
      Update: Chapter Three have created a PHP Apple News library here https://github.com/chapter-three/AppleNewsAPI
    • By flydev
      OAuth2Login for ProcessWire
      A Module which give you ability to login an existing user using your favorite thrid-party OAuth2 provider (i.e. Facebook, GitHub, Google, LinkedIn, etc.)..
      You can login from the backend to the backend directly or render a form on the frontend and redirect the user to a choosen page.
      Built on top of ThePhpLeague OAuth2-Client lib.
      Registration is not handled by this module but planned.
       
      Howto Install
      Install the module following this procedure:
       - http://modules.processwire.com/modules/oauth2-login/
       - https://github.com/flydev-fr/OAuth2Login
      Next step, in order to use a provider, you need to use Composer to install each provider
      ie: to install Google, open a terminal, go to your root directory of pw and type the following command-line: composer require league/oauth2-google
      Tested providers/packages :
          Google :  league/oauth2-google     Facebook: league/oauth2-facebook     Github: league/oauth2-github     LinkedIn: league/oauth2-linkedin
      More third-party providers are available there. You should be able to add a provider by simply adding it to the JSON config file.

      Howto Use It
      First (and for testing purpose), you should create a new user in ProcessWire that reflect your real OAuth2 account information. The important informations are, Last Name, First Name and Email. The module will compare existing users by firstname, lastname and email; If the user match the informations, then he is logged in.
      ie, if my Google fullname is John Wick, then in ProcessWire, I create a new user  Wick-John  with email  johnwick@mydomain.com
      Next step, go to your favorite provider and create an app in order to get the ClientId and ClientSecret keys. Ask on the forum if you have difficulties getting there.
      Once you got the keys for a provider, just paste it into the module settings and save it. One or more button should appear bellow the standard login form.
      The final step is to make your JSON configuration file.
      In this sample, the JSON config include all tested providers, you can of course edit it to suit your needs :
      { "providers": { "google": { "className": "Google", "packageName": "league/oauth2-google", "helpUrl": "https://console.developers.google.com/apis/credentials" }, "facebook": { "className": "Facebook", "packageName": "league/oauth2-facebook", "helpUrl": "https://developers.facebook.com/apps/", "options": { "graphApiVersion": "v2.10", "scope": "email" } }, "github": { "className": "Github", "packageName": "league/oauth2-github", "helpUrl": "https://github.com/settings/developers", "options": { "scope": "user:email" } }, "linkedin": { "className": "LinkedIn", "packageName": "league/oauth2-linkedin", "helpUrl": "https://www.linkedin.com/secure/developer" } } }  
      Backend Usage
      In ready.php, call the module :
      if($page->template == 'admin') { $oauth2mod = $modules->get('Oauth2Login'); if($oauth2mod) $oauth2mod->hookBackend(); }  
      Frontend Usage
      Small note: At this moment the render method is pretty simple. It output a InputfieldForm with InputfieldSubmit(s) into wrapped in a ul:li tag. Feedbacks and ideas welcome!
      For the following example, I created a page login and a template login which contain the following code :
      <?php namespace ProcessWire; if(!$user->isLoggedin()) { $options = array( 'buttonClass' => 'my_button_class', 'buttonValue' => 'Login with {provider}', // {{provider}} keyword 'prependMarkup' => '<div class="wrapper">', 'appendMarkup' => '</div>' ); $redirectUri = str_lreplace('//', '/', $config->urls->httpRoot . $page->url); $content = $modules->get('Oauth2Login')->config( array( 'redirect_uri' => $redirectUri, 'success_uri' => $page->url ) )->render($options); }

       
      Screenshot
       



    • By psy
      ProcessWire DropboxAPI on GitHub: https://github.com/clipmagic/DropboxAPI
       
      This module is a wrapper for Kunal Varma's Dropbox PHP SDK https://github.com/kunalvarma05/dropbox-php-sdk
      It was created to perform a specific function for a client, ie upload PDF files on a PW website to a specific Dropbox account folder.
      The PDF files, created using @Wanze's excellent PagesToPdf module using the WirePDF functions, are generated from Formbuilder forms completed by front-end site visitors.  Works a treat!
      There's more that could be done to allow ProcessWire to take advantage of all the features of the SDK, eg downloads, multiple Dropbox accounts, etc. You are welcome to request changes and/or fork the GitHub project to extend the feature set.
      Enjoy!
      System requirements
      PHP 5.6.4 or greater Composer The PHP mbstring extension General information
      This module enables you to access a single Dropbox (www.dropbox.com) account to upload files from a ProcessWire website.
      All kudos to (https://github.com/kunalvarma05/dropbox-php-sdk) for the PHP API.
      First steps
      Visit (https://www.dropbox.com/developers) and read the documentation. Log into Dropbox and create a new application. It's recommended to limit ProcessWire App access to a specified folder Make a note of the App key, the App secret and the name of the Dropbox folder Installation
      Download the zip file into your site/modules folder then expand the zip file. Next, login to ProcessWire > go to Modules > click "Refresh". You should see a note that a new module was found. Install the DropboxAPI module. Configure the module with your App key, App secret and your Call Back URL You need to generate a Dropbox access token to enable your site to communicate with the nominated Dropbox account. Dropbox will generate a token for you or you can create a page for the front end of your ProcessWire site with a template to submit the token request to Dropbox, eg:
      <?php namespace ProcessWire; $drop = $modules->get('DropboxAPI'); if ($input->get->code && $input->get->state) { $code = $sanitizer->text($input->get->code); $state = $sanitizer->text($input->get->state); //Fetch the AccessToken $accessToken = $drop->getAccessToken($code, $state); echo "Copy/paste this code into the module configuration: " . $accessToken; } else { echo "<p><a href='" . $drop->getAuthURL() . "'>Log in with Dropbox</a></p>"; } ?> Once you have entered the token in the module configuration, you can unpublish this page.
      Usage
      Read the dropbox-php-sdk documentation!
      An example template for sending a file to a Dropbox App folder from ProcessWire:
      <?php namespace ProcessWire; use Kunnu\Dropbox\Dropbox; use Kunnu\Dropbox\DropboxApp; use Kunnu\Dropbox\DropboxFile; // send pdf to Dropbox $drop = $modules->get('DropboxAPI'); $app = new DropboxApp($drop->app_key, $drop->app_secret, $drop->authorization_code); if ($app) { //Configure Dropbox service $dropbox = new Dropbox($app); $dropboxFile = new DropboxFile('/path/to/myfilename.pdf'); $file = $dropbox->upload($dropboxFile, "/myfilename.pdf", ['autorename' => true]); //Uploaded File meta data if ($file) { $success = $file->getName() . " uploaded to Dropbox"; $drop->log($success); } }  
       
    • By sirhc
      Hi all,
      Im trying to install this core module and got the error of not having the ImageMagick library installed.
      But if im checking for the version of my ImageMagick installed on my server via SSH im getting this response;
      identify -version
      Version: ImageMagick 6.9.4-9 Q16 i386 2016-06-21 http://www.imagemagick.org
      Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
      License: http://www.imagemagick.org/script/license.php
      Features: Cipher DPC 
      Delegates (built-in): bzlib freetype gslib jng jpeg png ps tiff xml zlib
      Does this even mean the library is installed? And if yes, why cant i install my module?
      Pleaassee help me
      Greetz.