-
Posts
10,896 -
Joined
-
Last visited
-
Days Won
348
Everything posted by adrian
-
@teppo and @bernhard - new version attached. This lets you add module settings for your custom panels to Tracy's settings - you can add something like this to your panel class: public function addSettings() { $fieldset = $this->wire('modules')->get("InputfieldFieldset"); $fieldset->attr('name+id', 'testThirdPartyModuleSettings'); $fieldset->label = $this->_x('Test Third Party Module Settings', __FILE__); $f = $this->wire('modules')->get("InputfieldCheckbox"); $f->attr('name', 'testThirdPartyModule_myCheckbox'); $f->label = $this->_x('My Checkbox', __FILE__); $f->attr('checked', \TracyDebugger::getDataValue('testThirdPartyModule_myCheckbox') == '1' ? 'checked' : ''); $fieldset->add($f); return $fieldset; } The name of the field can be whatever you want, but I think you should prefix it with the class of the panel, eg: testThirdPartyModule_myCheckbox to avoid any conflicts with Tracy core panel settings. What do you guys think of this? Do you think there is a better way to implement? Would you rather store any needed settings in your module's settings instead? Also, please note the name+id attribute in the fieldset - the value entered here should match the last parameter in the generatePanelFooter() method in your panel code. This links the cog icon at the bottom of your panel to the anchor link in Tracy's module settings. TracyDebugger.module.php
-
It's just a way for other ProcessWire modules to add their own panels to Tracy's debug bar. The custom panel can display all sorts of relevant debug info, just like the core panels included with Tracy. Really it's up to module authors what they think would be useful info to display. I am also just working on the ability for these external module panels being able to inject settings into Tracy's main module settings so that users can customize the panel.
-
@bernhard - not sure what to say. If you have a file called TestThirdPartModule.php and that file contains a class named "TestThirdPartyModulePanel" then it should work fine. Note that you can name the file and class whatever you want, so long as the class is the same as the file with the "Panel" suffix.
-
I have made this change and committed it to the repo. Please let me know how it goes for you.
-
Thanks @thausmann for those fixes and improvements - I've made a couple of small tweaks: 1) the title subfield is automatically selected now so that users don't need to do anything when exporting to get each column automatically added. 2) I added support for pageAutocompleteMultiple New version is committed to the repo and updated in the modules directory.
-
Hi @helin, Sorry for the late response. This has annoyed me for a long time and while it might seem like an easy fix, it has eluded me several times. I have put in another concerted effort and I think I have a working solution, but it would be great if you could test before I commit to the repo. Please try the attached file and let me know. It should work regardless of whether you have the "Rename on Save" option checked, but please note that if you upload a replacement file for a single image field (max allowed 1 file), then the -1 will be appended until you save the page - this is simply because the other image still exists until you save the page, so the filename must be adjusted, but it should now be removed if there are no other conflicting filenames. ProcessCustomUploadNames.module.php
-
@teppo and @bernhard Please try the attached main module file. With this version, you can simply add your panel to your module directory structure eg: /site/modules/TestModule/TracyPanels/TestThirdPartyModule.php Make sure the class name of the panel in this example is: TestThirdPartyModulePanel That should be all you need. Not super well tested so let me know if you find any problems or have any suggestions. If everything looks good, I'll commit the changes to the repo. TracyDebugger.module.php
-
Hi @thausmann - when exporting a table with a page reference field, it should export the title of the selected page(s), and not the ID so I am maybe confused about what you are seeing. The option to export a field from the referenced page would be great for sure. The way I'd envision this working would be for the "Columns / Order to Export" selection to work like Lister does with its ASM parents functionality where you select a parent and then get to select subfields, but I am rushed for time, so for the moment, I've just made it possible to select them as separate top-level items. Please try the not-well-tested version attached. Please feel free to make improvements. TableCsvImportExport.zip
-
I think it's probably good idea, but this is a request for @Pete and @ryan
-
Hi @teppo - I'd love to make it easier to support custom panels. It's interesting about the $allPanels array - it really wouldn't be necessary except for the title vs the name, eg "phpInfo" to "PHP Info". In most cases it would be easy to programmatically convert the case, except for those with acronyms (PHP, API, etc). I think you are probably correct that hooks might be problematic because Tracy is always loaded before all other modules. Perhaps module authors who want to add new Tracy panels could simply provide me with the path and panel class name and I can have Tracy check the location if the module is installed. Perhaps as simple as adding a new $externalPanels array that is added to as needed? This array could be merged into the $allPanels array which would probably need to be made multidimensional to support separate title and path properties so that https://github.com/adrianbj/TracyDebugger/blob/cc1c17e50487580f5c1e3485411d7c9a766b0a4f/TracyDebugger.module.php#L1526 would know what path to use to load these external panels. Anyway, I'll have a play around and see what I think will work best and send you a test version to work with.
-
Yeah, I know it's coming, but it's still often not that great of an improvement in size, whereas AVIF looks like it will be significant.
-
Thanks Horst - been following this a little lately - definitely keen because WebP just doesn't seem worth the effort given the often limited size reduction and lack of Safari support.
-
That's not actually Tracy - that is the PW core: https://github.com/processwire/processwire/blob/b429de71e33066f611b0bf6e2cc3782b7e5dafa3/wire/core/WireShutdown.php#L281-L286
-
@psy - I am not certain at this stage, but see this comment and the two before it: https://processwire.com/talk/topic/12208-tracy-debugger/page/76/?tab=comments#comment-178165 Seems like it wasn't due to Tracy in that case - any chance it might actually be something else for you too?
-
Don't forget that Tracy has a PHPInfo panel that you can use ?
-
@dab - are you sure you're actually running PHP 7.2? That error is coming from a return type declaration (https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) which was available since PHP 7. That said, I didn't mean to exclude < 7 and I don't need the declaration, so the new version just committed should work for you.
-
Just wanted to make a note here that I just wasted several hours trying to debug why I couldn't manually add or delete rows from a table when this module was installed. Turns out it was PHP's max_input_vars setting being too low, but no error was being logged anywhere. In the process of debugging I did fix a few bugs related to Table fields inside Repeaters and some other cleanup, so perhaps it was a worthwhile waste of time after all ?
-
if($user->hasRole('student') {
-
@Knubbi - easiest quick fix would be for you to change these two lines: https://github.com/adrianbj/ProcessAdminActions/blob/bb7738c59b62de19ad83bc84e147b2fedde93c2b/actions/FieldSetOrSearchAndReplace.action.php#L123 https://github.com/adrianbj/ProcessAdminActions/blob/bb7738c59b62de19ad83bc84e147b2fedde93c2b/actions/FieldSetOrSearchAndReplace.action.php#L142 replacing the '/' with '#' or other character.
-
Hi @Mike Rockett - just had a: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'referrer' at row 1 #22001 in /var/www/html/site/assets/cache/FileCompiler/site/modules/ProcessJumplinks/ProcessJumplinks.module.php:534 because someone was trying to hack in with this link: /plus/download.php?open=1&arrs1[]=99&arrs1[]=102&arrs1[]=103&arrs1[]=95&arrs1[]=100&arrs1[]=98&arrs1[]=112&arrs1[]=114&arrs1[]=101&arrs1[]=102&arrs1[]=105&arrs1[]=120&arrs2[]=109&arrs2[]=121&arrs2[]=116&arrs2[]=97&arrs2[]=103&arrs2[]=96&arrs2[]=32&arrs2[]=40&arrs2[]=97&arrs2[]=105&arrs2[]=100&arrs2[]=44&arrs2[]=101&arrs2[]=120&arrs2[]=112&arrs2[]=98&arrs2[]=111&arrs2[]=100&arrs2[]=121&arrs2[]=44&arrs2[]=110&arrs2[]=111&arrs2[]=114&arrs2[]=109&arrs2[]=98&arrs2[]=111&arrs2[]=100&arrs2[]=121&arrs2[]=41&arrs2[]=32&arrs2[]=86&arrs2[]=65&arrs2[]=76&arrs2[]=85&arrs2[]=69&arrs2[]=83&arrs2[]=40&arrs2[]=57&arrs2[]=48&arrs2[]=49&arrs2[]=51&arrs2[]=44&arrs2[]=64&arrs2[]=96&arrs2[]=92&arrs2[]=39&arrs2[]=96&arrs2[]=44&arrs2[]=39&arrs2[]=123&arrs2[]=100&arrs2[]=101&arrs2[]=100&arrs2[]=101&arrs2[]=58&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=125&arrs2[]=102&arrs2[]=105&arrs2[]=108&arrs2[]=101&arrs2[]=95&arrs2[]=112&arrs2[]=117&arrs2[]=116&arrs2[]=95&arrs2[]=99&arrs2[]=111&arrs2[]=110&arrs2[]=116&arrs2[]=101&arrs2[]=110&arrs2[]=116&arrs2[]=115&arrs2[]=40&arrs2[]=39&arrs2[]=39&arrs2[]=57&arrs2[]=48&arrs2[]=115&arrs2[]=101&arrs2[]=99&arrs2[]=46&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=39&arrs2[]=39&arrs2[]=44&arrs2[]=39&arrs2[]=39&arrs2[]=60&arrs2[]=63&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=32&arrs2[]=101&arrs2[]=118&arrs2[]=97&arrs2[]=108&arrs2[]=40&arrs2[]=36&arrs2[]=95&arrs2[]=80&arrs2[]=79&arrs2[]=83&arrs2[]=84&arrs2[]=91&arrs2[]=103&arrs2[]=117&arrs2[]=105&arrs2[]=103&arrs2[]=101&arrs2[]=93&arrs2[]=41&arrs2[]=59&arrs2[]=63&arrs2[]=62&arrs2[]=39&arrs2[]=39&arrs2[]=41&arrs2[]=59&arrs2[]=123&arrs2[]=47&arrs2[]=100&arrs2[]=101&arrs2[]=100&arrs2[]=101&arrs2[]=58&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=125&arrs2[]=39&arrs2[]=41&arrs2[]=32&arrs2[]=35&arrs2[]=32&arrs2[]=64&arrs2[]=96&arrs2[]=92&arrs2[]=39&arrs2[]=96 I'm not sure the best approach to preventing this exception - not sure if you should change the field type for the referrer column to support larger entries, or if you should just truncate the referrer if it's longer than allowed.
-
Hi @gebeer - sorry that didn't help. Looking through the module code there are only a couple of places where "/admin/module/edit?name=TracyDebugger" appears. One is in the PW Info panel, so could you please disable that and see if it fixes things. The other is in the main module file, so could you try removing this block of code: https://github.com/adrianbj/TracyDebugger/blob/c499ad75ffce7ce473dfd32ef994339a27d61b83/TracyDebugger.module.php#L1124-L1135
-
Something like this will get you the list of roles for the current page. $modules->getModuleConfigData('PageProtector')['protectedPages'][$page->id]['roles'];
-
Hi @gebeer - I am not really sure, but my initial hunch is that somehow the last entered code is corrupt. Could you try deleting any browser LocalStorage entries for the site. You can go through and just delete the ones that refer to Tracy if you'd prefer.
-
@BFD Calendar - I don't really think this module is the best option for your needs in this case - sounds like you should just handle each condition in your code.
-
I hate this behavior, but if you just want it for external links, there is: http://modules.processwire.com/modules/textformatter-mark-external-links/ or my highly modified version attached. I do my best to convince clients not to this, but some just won't listen. Read why it's a bad idea: https://www.smashingmagazine.com/2008/07/should-links-open-in-new-windows/ https://www.w3.org/TR/WCAG20-TECHS/G200.html https://pinksheepmedia.com/2019/05/in-general-hyperlinks-should-open-in-the-same-window/ https://knowbility.org/blog/2019/links-opening-new-windows-no-warning/ TextformatterMarkExternalLinks.module