Jump to content

adrian

PW-Moderators
  • Posts

    11,101
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. A few more updates to mention. 1) Tracy now correctly reports warnings/notices coming from PW's file/image AJAX uploads For those following the thread on CustomUploadNames and on Github, not only did Ryan make some changes in the PW core to make this work, but David Grudl over at Nette also added a workaround that now allows Tracy to report errors from vanilla JS ajax calls, even if they don't call xhr.getAllResponseHeaders(); which should help with debugging your own vanilla js ajax calls as well. 2) Easy toggle for Strict Mode Not sure how many of you have played with the Strict Mode config setting. It turns notices and warnings into errors and shows a full expandable stack trace. For example, here is the above notice in Strict Mode. Clicking on the "source" and "arguments" on the entries further down the call stack can be very helpful! This is great, especially for AJAX notices/warnings which are often harder to dig into. The catch has always been that Strict Mode will halt your scripts for these notices/warnings, which can often be painful when you are early into something complex and just want to get it working before dealing with these. Now on the Panel Selector panel the new toggle button makes it easy to turn on Strict Mode when needed (note this is only available if Strict Mode is off in the module config settings): 3) Time and memory of Console Panel code I recently added time and memory of the code run in the console panel. Note the 11.59ms and 0.07MB at the bottom of the output. This could be very handy if you want to test the performance of different selectors or loops. Hope you guys find these new additions useful!
  2. Ryan just added those xhr.getAllResponseHeaders() calls to the dev branch! Keep in mind that Tracy will still remove warning/notices from the AJAX response, so uploads won't be stalled but now you'll at least be notified about the problem.
  3. Where do you define $pic ? Is "pic" the name of your images field? In this case you would want $match->pic->url Also, check the max files setting of that field. If it's not "1", then it will return an array of images and you'll need: $match->pic->first()->url
  4. Or you could have new child pages automatically added to the page table field: Be sure to read the comment two posts lower which mentions a bug and a fix.
  5. Hi @ukyo and @horst - just another follow up on the suppression of notices/warnings by Tracy. I have discovered that it's because PW image and file uploads use vanilla JS calls that don't use xhr.getAllResponseHeaders(); This prevents Tracy from being able to update its AJAX debug bar with any notices/warnings returned from the AJAX request. I have just posted an issue (https://github.com/processwire/processwire-issues/issues/137) in the hopes that Ryan will consider adding xhr.getAllResponseHeaders(); to both of these. I have tested here and it works great and I actually think it will be of great benefit to beginners debugging image/file upload problems who aren't used to looking for AJAX errors in the Network panel of the browser dev console because now any notices/errors will appear very obviously on the Tracy AJAX debug bar. If you're willing, I'd love a show of support for this change on that Github issue. Thanks!
  6. Any chance it's a third party module? Maybe you could rename the modules db table and the site/modules directory, and clean up the filecompiler cache directory. Maybe also the caches db table?
  7. Have you tried to debug the contents of $page that is passed to the loaded() method in the line above?
  8. Looks like you are not alone:
  9. Leave that line the way you had it and just delete this line: $wire = $this->wire();
  10. Looking at the languages site profile, there is no _head.php file: https://github.com/processwire/processwire/tree/dev/site-languages/templates Maybe you are combining files from different profiles? Regardless, the key thing is that $homepage is null so you need to define it somewhere before the line that calls the getLanguageValue on it. Currently the languages site profile does this in the _init.php file: https://github.com/processwire/processwire/blob/e12095e622555fe79cd792dea1ed7d671e37d9d4/site-languages/templates/_init.php#L26
  11. Hi @Ivan Gretsky - I've added some options for controlling the automatic backup (not committed yet) and I am thinking about the guest user access for making calls to actions via the API. I am considering a couple of different options and will put together something in the next couple of days. Hope that works for your timeframe?
  12. I think you are much better off defining distinct "styles" for Ckeditor rather than allowing full manipulation - if you give editors free reign to change colors, you're likely to end up with a really ugly site. You can read more about setting up styles here: https://github.com/processwire/processwire/blob/dev/wire/modules/Inputfield/InputfieldCKEditor/README.md#custom-editor-css-file
  13. I am not a big multi-language user, but what I have done previously is to add this to the ajax URL: &lang=es and then in the file that is called: $user->language = $languages->get($sanitizer->selectorValue($input->get->lang));
  14. Another update which now also fixes bd() and all other calls from the Console Panel when the SessionHandlerDB module is installed - the AJAX bar will be immediately updated now. I think we can now declare that there are no outstanding issues with that module, but please let me know if any of you come across anything I have missed!
  15. For those of you who like using the SessionHandlerDB module, I have just implemented a fix (thanks to David Grudl over at Nette) for the whitescreen issue that was happening with a Modules > Refresh and some other actions when your php.ini had output_buffering set to off / 0 As far as I can tell the only outstanding issue with SessionHandlerDB is calling bd() from the Console panel - this still doesn't work, but in most cases d() is better from here anyway.
  16. Yes, I think you are correct that it's only in 2.8 and 3. Personally I would recommend upgrading. You are missing out on lots of great functionality. If it's a legacy site without much of a budget for maintenance go with 2.8. Otherwise go with 3.x - I have upgraded many sites from 2.7 to 3.x without any problems.
  17. I am not a twig or latte user, but if you figure out some changes to Tracy that are needed to work well with these, please let me know - happy to help support them. I would expect there is an easy way with latte given that they are both by the Nette guys.
  18. @gmclelland and @Zeka - sorry about that - should be fixed in the latest version. Please let me know if you have any other troubles!
  19. Hi @Ivan Gretsky I think I would store the options in a textarea in json format so you can easily convert to an array to pass to the action via the API call. Are you planning on having the security string in the link from the email and handling the authentication in the logic on your pages? Currently the automatic backup can't be turned off, but I agree that this should be possible. I'll do it as a configurable option and also add an option to turn it off via an API call. Let me know if you come across any issues once you start setting this up and I'll see what I can do to make AdminActions work as needed for you.
  20. Fixed by: https://github.com/processwire/processwire/commit/622896e028aba214a5431b34606f94518b35953d
  21. On the Input tab of the field's settings: PS - what's the website? That's the first time I have seen someone on the forums, besides myself, need to enter Ammonium
  22. Just for reference: https://github.com/processwire/processwire-issues/issues/130 If you want a quick fix until @ryan gets this sorted, just add the $options argument to the User version of the method, eg. public function editUrl($options = array()) { on this line: https://github.com/processwire/processwire/blob/e8b9f1294311a9e57d05b5cb5b7395b7685e951b/wire/core/User.php#L448
  23. This functionality is now built into the core so you can use with ML textareas:
  24. No problem at all - glad you decided to stick around - it's nice to have some more Canucks here!
  25. $thumbnail = $page->image->first()->size(600,480); Although if I have an images field that is named to sound like a single image, eg "image" then I always make sure to set the max to 1, rather than 0 so I don't get confused about whether it's going to be a single image or an array.
×
×
  • Create New...