Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. @ryanC - I don't know what that wireMail() isn't working. I just copied the code from @szabesz's post and with the Mail Interceptor panel enabled, it returned the same result that he had - a successful mail. Just curious - did the AJAX bar appear below the main Tracy debug bar? Assuming you installed a recent version of Tracy your screenshot is showing the main Mail Interceptor panel, not the one updated by Console mail call. Actually it looks like @szabesz has an old version also. See my screenshot showing the AJAX version with (ajax) in the header:
  2. Hi @Robin S - I just tested creating a repeater item here via the API and didn't have any problems. Any tips on how I might be able to reproduce this? Maybe send me an export of your repeater field, and an export of your PageRenameOptions settings (ModuleSettingsImportExport makes this easy) in case there is some other setting that is also involved.
  3. The other tool we have that might be useful is: permissionMethod
  4. Does this help? Looks like calling the module and using getDefaultData() on it works here:
  5. Does adding this to your config.php help? $config->defaultAdminTheme = 'AdminThemeUikit';
  6. If you're think you're going crazy (I did ) and wondering why you can't uninstall modules on your site, please update Tracy! - the new Request Info panel was the cause. I also just fixed an issue with the ProcessWire Version Switcher panel. Not sure when it stopped working as expected (I think maybe a PW core change affected it?), but it wasn't doing a final reload after the version was changed which made it look like nothing had happened. This is now fixed and once again makes it possible to change core versions with one click.
  7. Nice little improvement to the ProcessWire Info panel. I have reduced the admin links section down to some basics: Admin Login / Logout Clear Session & Cookies Tracy Debugger Settings. The removed links can now be added as you wish via the "Custom Links" section. This is configurable in the module settings and lets you link to any page in the Page Tree. The two screenshots show the same custom links (with and without labels). You'll notice that I have added links to a few Process modules (Upgrades, Changelog, and Cache Admin), along with the links that used to be available by default, and then another link to "Add Page" and also to a plain page (My Special Page). Personally I am just going to remove many of these for my own setup so it's just down to those I use a lot. For example I will definitely delete the "Fields", "Templates", and "Roles" links because I rarely want to go to those parent pages anyway - I always want to go via the admin submenus to go to a specific template or field, etc. Anyway, hopefully you'll all find this a useful way to add shortcuts to regular admin tools from the frontend of your sites. On a minor technical note, the module settings for these custom links actually converts the page IDs to page paths so that you can use the Module Settings Import Export module to setup Tracy on other sites without having to redefine these links (because page IDs for non admin pages will be different).
  8. I haven't looked at the details here, but I wanted to mention that maybe you should be careful of the $parent_name in array check. Maybe parent->path would be safer. There is always the chance that you could end up with two pages on different branches with the same name. Also, remember that we have $input->url (instead of $_SERVER['REQUEST_URI']). What about this: if(strpos($input->url, page()->parent->path) !== false) throw new Wire404Exception();
  9. adrian

    Hanna Code

    Not sure I have tried to access a function inside a Hanna code before so defining in the code might make sense, or include() 'ing the file. Or in the Hanna code wrap the function definition in a if(function_exists()) wrapper so the function will only be defined once.
  10. adrian

    Hanna Code

    Might be a namespace issue - try calling it with: $summ = \wordLimiter($properties->body); or: $summ = \ProcessWire\wordLimiter($properties->body); Not sure what namespace your _func.php file is in.
  11. Just a quick update to let you all know that: 1) With lots of help from @gmclelland we have been ticking off a lot of PHP 7.2 errors. Not sure that we have discovered them all yet though, so please let me know if you come across any. 2) I just forced the Validator panel to use the HTML5 version all the time. I was finding the other version wasn't working for some sites. Hopefully this won't cause any problems, but please let me know if you find anything amiss.
  12. Firstly, sorry about the number of settings in Tracy - that isn't a sign of your lack of PHP knowledge, but rather a sign of my indecisiveness Really this is up to you. I leave it running - it's not accessible to regular users anyway. In production mode it can send you emails when it logs errors. But if you want you can uncheck the "Enable Tracy" option so there is no load at all from it, although it's not noticeable in production mode anyway.
  13. Actually @alan - I should note that in some instances using the Console panel for this purpose may not achieve what you are looking for. If your template had overridden $user somewhere you might be better off doing bd($user) or bd($user->name) just before that isLoggedin() check so you know you are getting the value that is being used right there in your code. You can do this in your code editor, or you can even do it in the Template Editor panel and use the "Test" button - that way no changes are even made to your template files, so no need to remove debug statements when you're done. Have a read here: https://processwire.com/blog/posts/introducing-tracy-debugger/#template-editor-panel
  14. @theoretic - have you had a look at @Macrura's new module: https://processwire.com/talk/topic/17458-settings-train-module-preview-all-aboard/? Maybe this will take care of your needs?
  15. Sorry if it seems like I am promoting Tracy here, but if you were using her, you could just do this in the Console panel and you'd instantly see if $user is an object and what the name of that user is.
  16. The video fieldtype can do autoplay and loop - take a look at the Mediaelement API (https://github.com/mediaelement/mediaelement/blob/master/docs/api.md). You can also completely replace the video rendering code in the settings of the module with another player if you'd prefer. Not to say that a normal files field isn't fine, the Video fieldtype just makes it easier to manage videos in the backed because it creates images, shows the length of videos, and a few other things. Really depends on your needs as to what will be best.
  17. Or if you want a solution for generating poster images and providing an easy play option, check out: https://github.com/adrianbj/FieldtypeVideo
  18. Any chance this is helpful: https://processwire.com/talk/topic/5658-alpha-release-usergroups-page-based-permissions/
  19. @Livius - welcome to the forums! If it's just one branch per user, then this will do what you need: http://modules.processwire.com/modules/admin-restrict-branch/
  20. http://caniuse.com/#search=mp4 But I am also using http://www.mediaelementjs.com/ as the default player in that module - it has a flash fallback for any browsers that don't support mp4
  21. Absolutely, although you need to consider if there are any resource issues with calling ffmpeg-php's getDimensions() at runtime - are you just processing one video at a time on the frontend? I worry that if you are processing many at a time that this might be an issue. Ideally it would be good to store width/height on upload, but there is no easy place to store these in the PW db structure. In the Video fieldtype module I actually rely on the dimensions of the created thumbnail so it's not an issue.
  22. It is currently designed as a video only fieldtype, but if you want to allow other files as well, it shouldn't be hard to implement that option. As for returning width and height - it determines them and uses them when using ->play() but yes it doesn't make them available via ->width() / ->height(). It would also be a pretty easy addition.
  23. Not meaning to hijack, so maybe any further conversation should be continued in its thread, but what aboutL https://processwire.com/talk/topic/11016-autocontent-generator/ If someone finds a better non-lorum text generator I'd be happy to integrate it into that module. What do you guys think of the approach used in that module vs the manual approach discussed here?
  24. Just add this to Tracy's Console panel: $selector = "template=basic-page, title=Contact 2"; d($pages->find($selector)->each("title")); d($pages->getPageFinder()->find(new Selectors($selector), array('returnQuery' => true))->getQuery(), array('maxLength' => 99999)); I save it as "Selector SQL Generator". This will return the results of the selector in the first dump and the SQL in the second. Let me know if you have any troubles with it.
  25. Which one - the one to generate an SQL query from a PW selector, or the actual SQL query itself?
×
×
  • Create New...