Jump to content

bernhard

Members
  • Posts

    6,631
  • Joined

  • Last visited

  • Days Won

    359

Everything posted by bernhard

  1. And https://processwire.com/store/form-builder/ has a stripe integration as far as I know
  2. Another issue that I just found is that it breaks the console 😞 The first request goes through and I get the result of d($page) in the dumps area, but I also get this in the devtools console: VM20245:1 Uncaught QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'tracyConsoleTabs' exceeded the quota. at xmlhttp.onreadystatechange (<anonymous>:1:287591) I really don't want to bother you with this edge case scenario but maybe there is not much to it to fix it?!
  3. Hey @adrian I'm using HTMX on my current project, specifically hx-boost which turns every regular link on the page into an ajax-powered link. It makes the request and then swaps out the content without a new page load. This is mostly great but sometimes introduces issues, for example the tracy debug bar needs to be out of the swapped area to stay on the page. I managed to do that and thought it was working well. The debug bar stays on the page and for each link that I click I get another AJAX entry in the debug bar, which is great πŸ™‚ Today I realised that when I click the browser's back button I get this error and the debug bar disappears: tool/?_tracy_bar=js&v=2.10.10&XDEBUG_SESSION_STOP=1:34 Uncaught TypeError: Cannot read properties of null (reading 'Tracy') at new Panel (tool/?_tracy_bar=js&v=2.10.10&XDEBUG_SESSION_STOP=1:34:31) at tool/?_tracy_bar=js&v=2.10.10&XDEBUG_SESSION_STOP=1:453:30 at NodeList.forEach (<anonymous>) at Debug.loadAjax (tool/?_tracy_bar=js&v=2.10.10&XDEBUG_SESSION_STOP=1:451:48) at tool/?_tracy_bar=content-ajax.db1c54dcde_4&XDEBUG_SESSION_STOP=1&v=0.5514348022883848:1:13 Do you think this is something that can be accounted in Tracy Debugger? It's not critical, but a bit annoying. So if there is a simple solution for it I'd be thankful πŸ™‚
  4. You can apply any SQL you want by hooking into the PageFinder: $wire->addHookAfter("PageFinder::getQuery", function (HookEvent $event) { // get the DatabaseQuerySelect object $query = $event->return; // dump the object to tracy // https://i.imgur.com/BdDEQU3.png bdb($query); // modify the query to only find pages with name length < 5 $query->where("LENGTH(pages.name)<5"); // remove the hook after first execution $event->removeHook(null); }); bd($pages->find("id>0")); The idea is to add the hook directly above your $pages->find() call and inside the hook you remove it so that it does not apply to any other $pages->find() operations that might occur later. This is a DatabaseQuerySelect object: And with that object you can add any custom ->where() or ->join() or whatever you need.
  5. You can add the class InputfieldIgnoreChanges to your field then the warning will not appear. Check out inputfields.js:
  6. Hey @adrian that works! I added a pull request for that and also added another one to improve dumps when using latte. The problem here is that when using latte files and adding a {bd('whatever')} in those files tracy actually picks up the compiled cache file and not the source file: source: /site/templates/latte/includes/foo.latte cache: /site/assets/cache/Latte/latte-includes-foo.php The implementation is kinda hacky and uses rockfrontend's dom tools to parse the html content of the dumps panel and then rewrite it to my needs. I didn't find a better option to modify what tracy puts in its bd() editorlinks output. If you know one let me know!
  7. I'm not sure I understand. buildForm is called when the form is rendered, which would be a GET request. So this is how you could set defaults based on get params: $form->addText('demo', 'Demo') ->setDefaultValue(wire()->input->get('demo')); Again you need to import wire() correctly or use $form->wire->input
  8. The only breaking change in v6 was the changes introduced in RockFrontend regarding ->styles() and ->scripts(), see https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/asset-tools/#upgrade-guide If you need help just let me know!
  9. If all RockPageBuilder files are in /site/modules/RockFields please just rename that folder to /site/modules/RockPageBuilder and you should be fine πŸ™‚
  10. Hey @gebeer RockFields is part of RockPageBuilder and should not be in /site/modules/RockFields but in /site/modules/RockPageBuilder I think you have a custom folder structure that is not intended. This is how it should be:
  11. You need to have the proper use statement at the top or use the full name with the namespace: RockForms have "namespace RockForms", so if you use "rockforms()" in this file it will look for "\RockForms\rockforms()" which does not exist. So you either use "\ProcessWire\rockforms()" or you add the use statement. If that's not done correctly my ide shows me the problem: PS: You can also use $form->rockforms()
  12. Hey @adrian this is a bit special, but maybe it's an easy fix, I don't know πŸ™‚ I love these direct IDE links in dumps that open up the file in question right in my IDE when clicked: The problem is that @Sanyaissues and I have been working on improving RockMigrations deployments and Michael also suggested to put all PW files into /public This leads to a folder structure like this: /Users/bernhard/projectx /public /site /wire /src foo.latte bar.latte When I set localRootPath to /Users/bernhard/projectx/public/ links for files inside the PW root work (eg /site/ready.php) BUT links for files to /src/foo.latte do not 😞 I have all my latte files outside of /public. Also all assets (css/js) are in the /src folder and then compiled, merged and minified via RockDevTools to /public/dst I was hesitant to go with such a setup at first because I was expecting issues. I already had to refactor my modules to support that setup and there are likely some spots still to fix. But I think it is a great setup and it is worth the effort. What do you think? Is that something you could support for tracy debugger as well? Maybe it's just do add a new (optional) setting like "projectRoot" so that paths to can properly be rewritten: /var/www/html/src/foo.latte /Users/bernhard/projectx/src/foo.latte /var/www/html/public/site/ready.php /Users/bernhard/projectx/public/site/ready.php At the moment the result is this: /var/www/html/src/foo.latte /var/www/html/src/foo.latte /var/www/html/public/site/ready.php /Users/bernhard/projectx/public/site/ready.php I guess it's because it does not find $config->paths->root in the filename and thus does not apply a str_replace? Thx a lot in advance πŸ™‚
  13. Hey @Spinbox I have just added support for showIf also checking other form fields on the block (not only other settings) and it now supports complex conditions like these: 'showIf' => 'advancedOptions=1 && (layout=grid || layout=list)', 'showIf' => 'whatever=1 || text="foo bar"', https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/settings/#conditionals-showif
  14. Ok I still don't understand but here you go: $f = $form->addRadioList('demo', 'Demo', [ 'foo' => 'Foo Option', 'bar' => 'Bar Option', ]); $form->rockforms()->hookField(function (HtmlPageCrawler $field) { // $field->outerHtml() is the whole field pair (label + input + errors) // find all defined <label> elements $field->filter('label')->each(function (HtmlPageCrawler $label) { // $label->html() is something like this: // <label><input type="radio" name="demo" value="foo">Foo Option</label> // get <input> element $input = $label->filter('input')->first(); // no input found (this is the field pair label) if (!$input->count()) return; // get input html $inputHtml = $input->outerHtml(); // remove input and get remaining inner html $input->remove(); $rest = $label->html(); $label->replaceWith("$rest - whatever - $inputHtml"); }); }, $f); Unfortunately Nette is quite complicated when it comes to modifying markup. You could write a custom renderer, but that's also not so easy. That's why I have built the hookField helper that uses RockFrontend's dom tools to do whatever markup manipulation you need. For simpler use cases (eg displaying two fields side by side) check out the addMarkup() helper: $form->addMarkup("<div class='uk-flex'>{field1} {field2}</div>"); Since you need to change the inner markup structure of the field it is a bit more complex in your scenario πŸ™‚
  15. Hey @Jochen Fritsch there are several ways to achieve this, but may I ask WHY you want to do that? There are reasons for it having this markup. AI Quote:
  16. Hey @Hackasacka I'm happy to announce that RockCommerce v1.4.0 supports custom payment providers via a very simple interface: <?php namespace RockCommerce; interface PaymentProvider { public function getPayment(string $id): Payment|false; public function createPayment(Order $order, array $data = []): Payment|false; } Please check out the new docs: https://www.baumrock.com/en/processwire/modules/rockcommerce/docs/payment-providers/
  17. Hi @elvina sounds like your user does not have the alfred permission:
  18. Hey @FireWire just wanted to let you know that the "Click To Translate All" feature bit me in my ** today πŸ™‚ It would be great to have an "Click To Translate All Empty" option, because I had the UI open like this: So I clicked "translate all" and boom both fields have been translated. I thought. But actually it also translated some of my other 57 fields on that page and I didn't realise! This can be a quite destructive operation, so it would be great if you could prioritise this issue if possible πŸ™‚ Thx a lot! PS: I wanted to provide a PR as the task seemed quite simple but Fluency has some quite complex JS setup that I don't understand and that involves a lot of tools I'm not using (babel/gulp) πŸ€―πŸ˜…
  19. Cool, thx! I've just pushed your suggested fix and it will be available soon as v1.3.2 πŸ™‚
  20. Ever wondered how long it takes for RockDevTools to collect the filemtime() for all watched files? I did, so I built a nice little info/debugging tool that will also help with customising /debugging which files are being watched: Result: For 541 files it takes around 1ms on my macbook air m1 😎
  21. This is not a specific request and might be no issue, just sharing what I observed and asking if that's maybe something that can easily be improved? Today I got a dump like this for my ajax request: This is the url hook used: wire()->addHook('/test/', function () { bd('test!'); return true; }); And this is how I fired the request in the devtools: fetch('/test'); note that I'm using "/test" as url (without a trailing slash). If I use the correct url the dump works as expected. Now obviously this is not a bug on tracys side, but I'm wondering if tracy can do anything about that? This is how the request looks in the debug bar: As you can see there are two requests, which makes sense, but if there are two requests shouldn't the second one have the correct dump? Or could it somehow show a warning that a wrong endpoint has been used to make it more obvious not to forget about trailing slash yes/no?
  22. PS: The "Flipper" feature has been possible before quite easily as well, but it got a lot nicer today!! --- code necessary for flipper buttons before today --- // year buttons RockGrid.on("button:year", (button) => { // set headerfilter of day column to // current date in format yyyy // reset all other columns filters table.clearHeaderFilter(); table.setHeaderFilterValue("day", luxon.DateTime.local().toFormat("yyyy")); }); RockGrid.on("button:prevyear", (button) => { // get current header filter of day column const filter = table.getHeaderFilterValue("day"); const year = filter ? luxon.DateTime.fromFormat(filter, "yyyy") : luxon.DateTime.local(); // set header filter to previous year table.clearHeaderFilter(); table.setHeaderFilterValue( "day", year.minus({ years: 1 }).toFormat("yyyy") ); }); RockGrid.on("button:nextyear", (button) => { // get current header filter of day column const filter = table.getHeaderFilterValue("day"); const year = filter ? luxon.DateTime.fromFormat(filter, "yyyy") : luxon.DateTime.local(); // set header filter to next year table.clearHeaderFilter(); table.setHeaderFilterValue("day", year.plus({ years: 1 }).toFormat("yyyy")); }); --- code as of today --- <span rg-flipper="field:date;range:year;">Y</span> <span rg-flipper="field:date;range:month;">M</span> <span rg-flipper="field:date;range:day;">D</span> So cool πŸ˜πŸš€
  23. RockGrid has seen a lot of great improvements over the last few days 😍 The whole codebase has been cleaned up and all javascript files have been split into several files to make maintenance easier. All of that was easily possible thanks to RockDevTools. RockGrid now supports so called "magic attributes" that can pull data from the grid and create UI elements completely automatic. TagsFilter The new tags filter pulls data from one column of your grid and lists all available options as clickable filter tags: All you have to do: <div rg-tagsfilter="field:your_field_name;"></div> --- Flipper I realised that when building grids for my custom bookkeeping software I built the same stuff over and over again, for example buttons to quickly flip over time periods (like the current year, previous year, this month, previous month, etc...). Now that's also built into RockGrid and can be used with a single dom attribute! 😎 All you have to do: <div rg-flipper="field:date_column;range:year;">Y</div> <div rg-flipper="field:date_column;range:month;">M</div> <div rg-flipper="field:date_column;range:day;">D</div> Go and check out RockGrid v1.6.0 πŸš€πŸš€
  24. Here we go!!! https://github.com/processwire/processwire/pull/322 Fingers crossed πŸ€žπŸš€πŸ˜
  25. Hey @gebeer unfortunately these migration properties do not work 100%. They work most of the time but not always. The code field and shift-click feature are supposed to be helpers, but you always have to confirm that it works. Some props can be used as they are, some props need transformers in RM and already have them and some might be missing. If you find any we might add an exception to the getCode() method or maybe somewhere else, I'm not 100% sure atm: https://github.com/baumrock/RockMigrations/blob/883b9e8f3bed37728fa1666514ae22042344681f/RockMigrations.module.php#L1852
Γ—
Γ—
  • Create New...